Skip to content

SDK Open API

Channel User Information Query Interface

This interface is used to query channel user information using the SDK channelUid.

Host

  • platform.hoolai.com

Protocol

  • Http
  • https

Method

  • POST

Path

  • /open/public/queryUser/{channel}
    channel: Path parameter, the current channel name, e.g., uc.

Request Header

  • Content-Type: application/json

Request Parameters

Parameter NameTypeDescription
productIdInteger/intGame product ID
channelIdInteger/intChannel ID
channelUidStringQuery channel UID

Request Response

  • Successful Response
json {
  "code": "SUCCESS",
  "requestId": "96501_174_1688093800",
  "value": {
    "openId": 199347787,
    "channelUid": "95715592e17eb7a21a64cc24e680b16e",
    "channel": "uc"
  },
  "group": "SUCCESS",
  "desc": "SUCCESS"
}

Note:

A code of SUCCESS means the query was successful. Any other code indicates failure.

  • Error Response
json {
  "code": "QUERY_INFO_NOT_EXIST",
  "requestId": "3_1010167180_1697598882304",
  "desc": "Query information does not exist",
  "group": "open"
}

TIP

Note: The above is only an example of when the query information does not exist. This is one of many error response types.

Public Account User Information Query Interface by Phone Number

Host

  • platform.hoolai.com

Protocol

  • Http
  • https

Method

  • POST

Path

  • /open/public/queryUser/officialAccount

Request Header

  • Content-Type: application/json

Signature Key

  • Contact SDK to obtain

Request Parameters

Parameter NameTypeDescription
phoneStringPhone number
timestampLong/longTimestamp in milliseconds
signStringMD5 signature MD5 (phone+productId+timestamp+secretKey) in 32 lowercase characters
productIdIntProduct ID

Request Response

Parameter NameTypeDescription
codeStringSUCCESS means success
valueJSON
  • Value Properties
Parameter NameTypeDescription
realNameStatusBooleantrue: real name verified false: not verified
userInfoJSONArray
  • User Info Attributes
Parameter NameTypeRemarks
productIdInteger
openIdLong
  • Successful Response
json {
  "code": "SUCCESS",
  "group": "SUCCESS",
  "value": {
    "realNameStatus": true,
    "userInfo": [
      {
        "openId": 201000641,
        "productId": 1
      },
      {
        "openId": 199347706,
        "productId": 73
      }
    ]
  },
  "desc": "SUCCESS",
  "requestId": "3_1010167180_1697598882304"
}

Note:

A code of SUCCESS means the query was successful. Any other code indicates failure.

  • Error Response
json {
  "code": "SIGN_NOT_MATCH",
  "group": "open-api",
  "desc": "Signature does not match",
  "requestId": ""
}

Note:

The above is just one example of an error response.

Send Verification Code

Host

  • platform.hoolai.com

Protocol

  • Http
  • https

Method

  • POST

Path

  • /open/public/sms/sendSms

Request Header

  • Content-Type: application/json

Signature Key

  • Contact SDK to obtain

Request Parameters

Parameter NameTypeDescription
productIdIntegerProduct ID
mobileStringPhone numbers, separated by commas (,) for multiple numbers
templateIdIntegerTemplate SMS ID, used to specify the required SMS template
accessTokenStringMD5 encrypted string: productId+"."+requestTime+"."+productKey, returned as a 32-character hexadecimal lowercase string
requestTimeLongThe current time in milliseconds when the request is made
separator (selectable)StringCustom separator. If not specified, the default separator (,) is used for splitting params. If provided, this separator will be used. Currently allowed separators are ".

Request Response

Parameter NameTypeDescription
codeStringSUCCESS means success
valueStringValue
descStringDescription
requestIdStringRequest ID
groupStringGroup
  • Successful Response
json 
{
    "code": "SUCCESS", 
    "requestId": "92982_124_1698634202", 
    "value": "SUCCESS", 
    "desc": "SUCCESS", 
    "group": "SUCCESS" 
}

Note:

A code of SUCCESS means the query was successful. Any other code indicates failure.

  • Error Response
json {
  "code": "SIGN_NOT_MATCH",
  "group": "open-api",
  "desc": "Signature does not match"
}

Note:

The above is just one example of an error response.

Censored Word Library/Image

This interface supports censorship information/image verification through the SDK API service.

Host

  • platform.hoolai.com

Protocol

  • Http
  • https

Method

  • POST

Path

  • /open/public/sensitive/moderation

Request Header

  • Content-Type: application/json

Request Parameters

Parameter NameTypeDescriptionRequiredOptional Values
productIdIntegerProduct IDYes
typeStringData type (image/text)Yesimage/text
sceneStringUsage scenario (e.g., chat, naming, etc.)NoCustomizable scene names and rules; needs to be configured in the Tencent Cloud backend
uidLongSDK user IDYes30000xxxxx
roleIdStringRole IDYesGame character ID
contentStringContentYesChat text/base64(image), images must be less than 10MB
signStringSignatureYesmd5(productId+type+uid+roleId+content+timestamp+key).timestamp
  • Note: key is the signature key provided by the SDK; timestamp is the Unix timestamp, valid for 5 minutes

Request Response

  • Response
json {
  "code": "SUCCESS",
  "group": "open-api",
  "requestId": "12244_323523_4322452",
  "value": {
    "suggestions": "pass",
    "showLabel": "You ****, you left right after starting the fight!",
    "reason": "Reason (selectable)"
  }
}

Note:

code being "SUCCESS" indicates the query was successful; all other values indicate failure.

  • suggestions: Possible values are pass / block. When the value is block, it is recommended that the game directly inform the user: “Contains inappropriate terms.”
  • showLabel: A filtered version of the input text; only applicable for text-type content.
  • reason: Specific reason (optional; may be absent). It is not recommended to use this text for in-game display.

Hoolai Access SDK