Prerequisites

To sync with the Single Push API, 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.

URL

Server URL
Production https://notification.withhive.com
Sandbox https://sandbox-notification.withhive.com

Basic Data and Request Variables

Method POST
URL /push/send
Division Field Name Description Type Required
Header Content-Type application/json;charset=utf-8
Authorization bearer {{API KEY}}
Body notice Whether to send announcement notification or not (Default: ‘false’)

true

  • Send as announcement notifications.
  • Send notifications depending on the user agreement.

false

  • Send as game notifications.
  • Send notifications regardless of user agreement.

Announcement and night-time notifications are the items required to get the user agreement.

  • If user doesn't agree to receive announcement notifications, all notices set as announcement are blocked to send.
  • Agreement on receiving night-time notifications are enable only after agreement on receiving announcement notifications; unless, all notices set as announcement are blocked to send at night. Night time is from 9 p.m. to 8 a.m.
Boolean O
identifiers Identifier information (up to 100) Check the identifier structureand example below. identifier[] O
game gameid Game ID String O
appids The list of AppID
Nothing is sent if the mapping AppID is invalid.

Recommendation

  • If device-base ID (did): Add the mapping AppID.
  • If account-base IDs (playerId, vid, uid): Add a list of the whole mapping AppIDs.
  • If various types of ID: Refer to the Identifier structure to check the priority.
String[] X
enableLocale Whether to enable the locale of each language or not

true

  • Send messages in the same language which target users set. It is based on the tokens and setting language code.
  • It determines the language when storing tokens.
  • Highest in priority: Game language
  • Second priority: Device language (Unless game language is sent)

false

  • Ignore the language locale and send as the value of single in payload field.
Boolean O
payload single Request to single field if enableLocale=false Check the Message structure below. Message O
defaultLanguage Set with the value of default language if enableLocale=true. String
locale {{LANGUAGE}} Set with the value of locale field if enableLocale=true` Same data with message information of single field. Message
option Refer to the optional information below. Option X
  • identifier Structure
    Division Field Name Description Type Required
    identifier identifier playerId One of four identifiers should be included It prioritizes playerId, vid, uid and did in order. Long O
    vid
    uid
    did
  • identifier Example
  • Message Structure
    iostitleTitleStringOfacebooktitleTitle (within 1~30 letters)StringO

    Division Field Name Description Type Required
    Message android title Title String O
    message Message String O
    messageExpanded Expanded message String O
    imageUrl Image URL String X
    ticker Ticker String X
    summaryText Summerized message String X
    message Message String O
    mediaUrl Image path String X
    body Body (within 10~180 letters) String O
    media Image URL String O
  • Option Information
    Division Field Name Description Type Required
    Option badge Digits exposed on app icon when receiving push messages(Default: 1) Integer X
    overwrite Whether to overwrite Android pushes or not(Default: false) Boolean X
    collapseKey Key values for overwriting pushes(Numeral string type: “123”) String X
    engagement User Engagement String X
    comment Comment String X
    groupKey The group key value to expose notifications in group when a user receives notifications in iOS or Android OS environment. The notification setting chosen in the device OS is applied by default. For more details about the option, see the following documentation.

    String X
    android icon This is the icon image file name exposed when a push notification appears on the user’s device. The image file should be located in /src/main/res/drawable. See here for the supported image file formats. If you want to expose an image on the web instead of an image file, type the image URL in this field instead of an image file name. If this field is left empty, the app icon image will be exposed. String X
    sound This is the name of the notification sound file to be played when a push notification appears on the user’s device. You can specify a sound source file included in the app bundle, and the sound source file should be located in /src/main/res/raw. If this field is left empty, the system’s default sound file is used. String X
    ios sound This is the name of the notification sound file to be played when a push notification appears on the user’s device. The sound source file should be located in Library/Sounds of the app container, or it must exist in the main bundle of your app. If this field is left empty, the value is automatically set to “default,” and the system default sound file of the user’s Apple device will be used. String X

Output Result

Division Field Name Description
Header Content-Type application/json;charset=utf-8
UUID {{UUID}}
Body Body is empty if success

Response State Code

Key Value Description
200 Success (Body is empty.)
400 Bad Request POST data is omitted.JSON format errorRequired element is omitted or invalid.
401 Unauthorized Authorization header in request message is omitted or invalid.Authorization key (API KEY) is not registered.No access permission to the relevant API
403 Forbidden Authentication 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 authentication server is frozen.

Sample Code

    • Call (“enableLocale“:false)
    • Call (“enableLocale“:true)

 

  • Request
  • Response