Home / Docs Center / Platform API / API Reference
API Reference
Project: Platform API | page_id: 77
Get channel name and secret key
- You need to register an account at https://platform.xstrive.com/
- Send the email account registered in step 1 to our staff to obtain the integration channel name
channeland the secret keysecret. - XSTRIVE public platform API request address: http://third.platform.xstrive.com
For a self-hosted platform you can access it locally: http://127.0.0.1/third/
Signature rules (token generation)
- The signature uses md5 encryption to generate the token parameter, which is passed for verification.
- Build the string to be encrypted using the secret obtained in step 1.
- Sort the string by the lexicographical order of the URL parameters (if upper and lower case are tied, upper case comes first) and join them with &.
Parameter sorting JS code example: keys = [key1,key2,...,secret,t]; keys = keys.sort();
For other languages, please refer to their own API documentation.
For example:
http://third.platform.xstrive.com/product/online?channel=common&productId=test144&token=c054ddeb010a3c44427bd3a345aba1ee&t=1577587794
String to be encrypted (all parameters except token):
sign = channel=common&productId=test144&secret=df138a4ffa97d1f8fe41646670ccc842&t=1577587794
After encryption: token = md5(sign) = c054ddeb010a3c44427bd3a345aba1ee
If the encrypted string matches the requested token, the signature verification passes.
Request content-type setting
header['content-type'] is application/x-www-form-urlencoded
Fixed parameters carried in requests
| Parameter | Description | Type | Required | Additional Notes |
|---|---|---|---|---|
| channel | Channel name | String | Y | |
| token | Signature string | String | Y | |
| t | Current timestamp | Number | Y | Unit: seconds |
Unified failure response JSON format
{
"code": Number, // error code
"msg": String // error message
}
Example:
{
"code":401,
"msg":"Illegal request"
}
Didn't find what you need?Contact us,Talk to our engineers directly.