Update Notes#
20230927#
Prerequisites#
Partners need to prepare the following information:Register a C5GAME account: You need to log in to the C5GAME official website or download the C5GAME APP to register an account. If the purchasing function is iterated later, you need to pre-recharge the account balance to complete the purchase of ornaments. You need to query the balance through the interface and recharge to ensure sufficient account balance, so as not to affect the use. Request Structure#
When calling the interface of the open platform, it means sending a request to our service address. You need to construct the request according to the interface address, request method, and request parameters, otherwise, the call will not succeed. A request example to query the balance is as follows:Service Address#
The existing service access address of C5GAME Open Platform is as follows:Communication Protocol#
All provided interfaces communicate via HTTPS, providing a high-security communication channel.Request Method#
Choose GET or POST methods to initiate requests according to the specific requirements of each interface.Request Parameters#
When initiating a request, the request body may contain two types of parameters: common request parameters and interface-specific business parameters.Common request parameters are included in every interface, currently, the query parameter is the app-key.
Interface-specific business parameters are unique to each interface, refer to each interface's parameter description.
Character Encoding#
Request and return results use the UTF-8 character set for encoding.Signature Mechanism#
Return Results#
API requests return the following results:
Call successful:{
"success": true,
"data": {
"userId": 111,
"balance": 100.21
},
"errorCode": 0,
"errorMsg": "",
"errorData": {},
"errorCodeStr": ""
}
{
"errorCode": 400001,
"errorMsg": "Please enter the correct app-Key",
"success": false
}
Field | Type | Always Returned | Description |
---|
success | Boolean | Yes | Whether the request was successful; true represents that the server-side process has completed without exceptions; if false, you need to look at the errorCode field error code and handle it accordingly |
errorCode | Int32 | Yes | Error code, when success is true, errorCode must be 0; when success is false, errorCode must not be 0 |
errorMsg | String | Yes | Error message, when success is true, errorMsg is an empty string; when success is false, errorMsg is an error description |
errorData | Object | No | Return data when an error occurs, this structure type is not fixed, each interface returns different types |
errorCodeStr | String | No | Brief English description of the error, only when success is false, may a non-empty string be returned |
data | Object | No | Business data returned when the request is successful, the structure varies according to each interface |
Glossary#
Name | Explanation |
---|
Service Domain | The domain name of our service, the production environment is http://openapi.c5game.com |
app-key | The key used by us for authentication, representing your credentials on our platform, please keep it safe. If leaked, others can also use this key to perform critical operations. |
How to Debug#
How to use the debugging function provided by the interface documentation:1.
Choose any interface, click the Debug button
2.
The first time you debug, you will be guided to set environment variables. Currently, you need to set the environment variable for the app-key. Please refer to the Prerequisites section for the method of obtaining it.
4.
After setting, click send to get the response parameters
Modified at 2023-09-29 06:32:00