Targeting Registration API is divided into API for registering targeting information and API for registering targeting data. When the API for registering targeting information requests basic data, the returned targeting ID and targeting description request to save upon running the API for registering targeting data. The targeting ID and its description are synced with the registration API for targeting information.

Prerequisites

To sync with the API for registering targeting information, make sure to issue an authorization token (API KEY). If you already have the key, request the additional permissions. Refer to HIVE Server API > Notification > Push v4 > Authentication to check how to request and issue the authorization token.

API for Registering Targeting Information

Basic Data and Request Variables

Method POST
URL /push/targets
Division Field Name Description Type Required
Header Content-Type application/json;charset=utf-8
Authorization bearer {{API KEY}}
Body company Company name (e.g., gamevil, com2us, gcp) String O
companyIndex Company code (the company number registered on AppCenter) Integer O
registrant id The ID of registration requester String O
name The name of registration requester String X
description Targeting title or description String O
game gameindex Game index Integer O

Output Result

Division Field Name Description Type Required
Header Content-Type application/json;charset=utf-8
UUID {{UUID}}
Body id Targetting ID Long O
company The same with Request data String O
companyIndex Integer O
registrant id String O
name String X
description String O
game gameindex Integer O
available Availability Boolean O

Response state code

Key Value Description
200 Success (Body is empty)
400 Bad Request POST data is omitted
JSON format error
Required element is omitted or invalid
Available to check additionally with reason message in Body
401 Unauthorized Authorization header in request message is omitted or invalid
Authorization token (API KEY) is not registered
No access permission to the relevant API
403 Forbidden Authorization scheme of Authorization header is not “Bearer” (Supported Bearer only)
404 Not Found Request URL is wrong
500 Internal Server Error Internal error on server
502 Bad Gateway Push gateway server is overloaded
Network connects in a wrong way
503 Service Unavailable API server or authorization server is frozen

Sample Code

  • Call
  • Request
  • Response
  • API for Registering Targeting Data

    Basic Data and Request Variables

    Method POST
    URL /push/targets/{{targeting ID}}/direct/new
    Division Field Name Description Type Required
    Header Content-Type application/json;charset=utf-8
    Authorization bearer {{API KEY}}
    Body The list of targeting data
    Check the targeting structure and example below.
    Target[] O
  • Targeting Structure
    Division Field Name Description Type Required
    Target Identifier playerId Make sure to input one of four identifiers. Long O
    vid Long
    uid Long
    did Long
    app appid String O
  • Targeting Example
  • Output Result

    Header Content-Type application/json;charset=utf-8
    UUID {{UUID}}
    SUCCESS: HTTP Status Code == 200

    Error

    Division Field Name Description Type Required
    FAILURE: HTTP Status Code !== 200
    Body error reason The reason of error occurrence String X

    Sample Code

  • Call
  • Request
  • Response