Skip to content

Server Integration Document

User Information Verification Interface

The user verification interface is used by the game server to validate the legitimacy of a user. The game server needs to call the SDK's server-side interface and determine whether the user is legitimate based on the response.

Host

  • platform.hoolai.com (domestic games in China)
  • global-platform.hoolai.com (overseas games)

Protocol

  • Http
  • https

Method

  • POST

Path

  • /official/original/validateAccessToken

Request Header

  • Content-Type: application/json
  • X-ACCESS-TOKEN: The accessToken obtained during client login. ()

Request Parameters

Parameter NameTypeDescription
productIdInteger/intGame product ID, from client initialization callback parameter [gameId]
channelString/stringGame channel (SDK channel key), from client initialization callback[channel]
channelIdInteger/intChannel ID, from client initialization callback parameter [channelId]
loginUidLongCurrently logged-in user ID, from client login success callback [uid]

Request Response

  • Successful Response
json
{ 
    "code": "SUCCESS", 
    "sign": "0daa95c4f278a77ceaadb01b62896a12.1650942836", 
    "value": "T0s=", 
    "desc": "SUCCESS", 
    "group": "SUCCESS" 
}
  • Error Response
json
{
  "code": "AUTHORIZE_INFO_ERROR",
  "requestId": null,
  "exceptionId": null,
  "desc": "Authorization information is incorrect",
  "group": "gateway"
}``` 
::: tip Note:
 The above is an example of an incorrect authorization error. This is only one of the many error response types. 
:::

## Payment Order Notification Interface

This interface is used to notify the game server that an order has been successfully paid after the client completes the payment, so the server can deliver the purchased goods. (<font style="color:red;">When integrating, make sure to validate the payment amount. If the amount in the notification does not match the original order amount, do not proceed with delivery.</font>)

### Protocol
- HTTP
- HTTPS

### Method
- GET

### Request Parameters

|Parameter Name|Type|Example|Description| 
| :-: | :-: | :-: | :-: | 
|order_id|String|0C7F3AFA0C404901B4A2CE056F79198C|SDK platform order number| 
|channel|String|hoolai/hoolaiappstore/xiaomi /xxxx|SDK platform channel identifier| 
|product_id|String|1/11/212/xxx|Game Product ID (on SDK platform)| 
|channel_id|String|12129/12144/xxx|Game Channel ID (on SDK platform)| 
|uid|String|209879034/248596079/xxxxx|User Platform UID| 
|pay_date|String|2022-05-07 13:25:55|Date and time of payment|
|amount|String|60/99/64800/xxxx|Payment amount (commonly multiplied by *100), e.g.,* 100 for RMB 1.00 or USD 1.00| 
|currency|String|	CNY/USD/TWD/EUR/xxxx|Currency (e.g., RMB, USD, EUR, etc.)|
|callback_info|String|MTExMTE./xxxxx|Game passthrough parameter, Base64-encoded (originally passed by the client via callback_info; before decoding, replace - with +, _ with /, and . with =. Ignore single quotes). Note: callback_info's max length is 50 characters, with no character restrictions.| 
|sign|String|d02ffcb1e9bb55853e0891577304b58d|Signature generated by sorting all parameters (excluding sign) in dictionary order, then appending product_key=<SDK_SECRET> and performing MD5 hashing. Example: md5(key=value&key=value&...&product_key=xxxx)

### Game Interface Response

#### Response Result Example

```nginx 
HTTP/1.1 200 OK 
Server: nginx 
Date: Mon, 08 Jun 2015 11:27:44 GMT 
Content-Type: text/html;charset=UTF-8 
Connection: keep-alive
  • If the response body is "ok" (case-insensitive), the notification is considered successful. Otherwise, the SDK will retry the notification multiple times at the following intervals (in seconds): A total of 13 attempts will be made. If all 13 attempts fail, the SDK will stop retrying and mark the order as undelivered. In such cases, manual delivery by operations staff will be required through the admin console.

Activity Order Notification Interface

This interface is used to notify the game server that a player has successfully participated in an event (such as redeeming a CDK).

Protocol

  • HTTP
  • HTTPS

Method

  • GET

Request Parameters

Parameter NameTypeExampleDescription
order_idString0C7F3AFA0C404901B4A2CE056F79198CSDK activity order number
channelStringhoolai/hoolaiappstore/xiaomi /xxxxSDK platform channel identifier
product_idString1/11/212/xxxGame product ID (on SDK platform)
channel_idString12129/12144/xxxGame channel ID (on SDK platform)
uidString209879034/248596079/xxxxxUser Platform UID
pay_dateString2022-05-07 13:25:55Date and time of payment
goods_idString200001Activity reward ID
role_idString1234567Game character ID
signStringd02ffcb1e9bb55853e0891577304b58dSignature generated by sorting all parameters (excluding sign) in dictionary order, then appending product_key= SDK_SECRET and performing MD5 hashing. Example: md5(key=value&key=value&...&product_key=xxxx)

Game Interface Response

Response Result Example

nginx
HTTP/1.1 200 OK 
Server: nginx 
Date: Mon, 08 Jun 2015 11:27:44 GMT 
Content-Type: text/html;charset=UTF-8 
Connection: keep-alive
  • If the response body is "ok" (case-insensitive), the notification is considered successful. Otherwise, the SDK will retry the notification multiple times at the following intervals (in seconds): A total of 13 attempts will be made. If all 13 attempts fail, the SDK will stop retrying and mark the order as undelivered. In such cases, manual delivery by operations staff will be required through the admin console.

Hoolai Access SDK