Introduction
ConnexionSDK Open API v1.0.0
1 Integration Preparations
- Request API Key and Secret Key
- Whitelist the external API requesting IP
- Integrate API according to the doc below
2 Basic Information
2.1 API basic information
- The following base endpoints are available: https://openapi.connexion.games
- All ports require API Key
- All ports respond with JSON format
- For GET actions, parameters required to be sent in query string
- For POST actions, parameters required to be sent in request body
2.2 IP restriction
- Whitelist is required for external visiting IPs
2.3 Required parameters in request header
- content-type: application/json
- X-CONNEXION-APIKEY: ${APIKEY}
- X-CONNEXION-SIGNATURE: ${SIGNATURE}
ps: ${APIKEY}is the API Key requested in rule 1, ${SIGNATURE} is the generated signature according to rule 2.4
2.4 Required parameter
Parameter | Type | Required | Description |
---|---|---|---|
timestamp | String | Yes | Second-level timestamp |
2.5 Signature generating rules
- Arrange all fields (excluding the fields in request header) in ascending order of the fields’ key value, then concatenate them according to key=value&key=value.....the string is named s1
- We use HMAC SHA256 method for signature. The SecretKey that corresponds to APIKEY is used as the key for HMAC SHA256,s1 is the target of HMAC SHA256, the resulting output is s2
- Turn s2 into lower case letters and now you obtain the signature
We are providing API SDK in three languages:
3 Ports
3.1 Userlist requesting port
Description
- Requesting user lists that are from the guild
Path
- /user/list
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
currentPage | Int | Yes | Current page |
pageSize | Int | Yes | Number of data on each page |
Sample Input Parameter:
timestamp=1234567890¤tPage=1&pageSize=10
Output
Name | Type | Enum | Description |
---|---|---|---|
total | Int | Total number of data | |
data | Array | Data array | |
> uid | String | In game user ID | |
> roleName | String | Character name | |
> roleType | String | Character type | |
> level | String | Level | |
> militaryCapability | String | Fighting capacity | |
> ranking | String | Fighting capacity ranking |
Sample Response:
{
"msg": "success",
"code": 0,
"data": [
{
"uid": "12345",
"roleName": "name",
"roleType": "warrior",
"level": "33",
"militaryCapability": "23580",
"ranking": "10"
},
...
],
"total": 1
}
3.2 User info requesting port
Description
- Requesting info of users that are from the guild
Path
- /user/info
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
uid | String | Yes | In game user ID |
Sample Input Parameter:
uid=1234523456×tamp=1234567890
Output
Name | Type | Enum | Description |
---|---|---|---|
data | Object | Data | |
> uid | String | In game userID | |
> roleName | String | Character name | |
> roleType | String | Character type | |
> level | String | Level | |
> militaryCapability | String | Fighting capacity | |
> ranking | String | Fighting capacity ranking | |
extraData | Object | Other data |
Sample Response:
{
"msg": "success",
"code": 0,
"data": {
"uid": "12345",
"roleName": "name",
"roleType": "warrior",
"level": "33",
"militaryCapability": "23580",
"ranking": "10",
"extraData": {
}
}
}
3.3 User fighting capacity ranking port
Description
- Requesting user fighting capacity ranking information
Path
- /global/topList/militaryCapability
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
topNum | Int | No | Top ranking counts, default 100, max 100 |
Sample input parameters:
topNum=100×tamp=1234567890
Output
Name | Type | Enum | Description |
---|---|---|---|
data | Array | Data | |
> roleName | String | Character name | |
> value | String | Fighting capcity | |
> ranking | String | Rank |
Sample output:
{
"msg": "success",
"code": 0,
"data": [
{
"roleName": "12345",
"value": "23580",
"ranking": "10"
},
...
]
}
3.4 User level ranking port
Description
- Request user level ranking information
Path
- /global/topList/roleLevel
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
topNum | Int | No | Top ranking counts, default 100, max 100 |
Sample input parameters:
topNum=100×tamp=1234567890
Output
Name | Type | Enum | Description |
---|---|---|---|
data | Array | Data | |
> roleName | String | Character name | |
> value | String | Character level | |
> ranking | String | Rank |
Sample output:
{
"msg": "success",
"code": 0,
"data": [
{
"roleName": "12345",
"value": "23580",
"ranking": "10"
},
...
]
}
3.5 User 1v1 pvp rating ranking port
Description
- Request user 1v1 pvp rating ranking info
Path
- /global/topList/pvpPoints/1v1
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
topNum | Int | No | Top ranking counts, default 100, max 100 |
Sample input parameters:
topNum=100×tamp=1234567890
Output
Name | Type | Enum | Description |
---|---|---|---|
data | Array | Data | |
> roleName | String | Character name | |
> value | String | Character 1v1 pvp rating | |
> ranking | String | Rank |
Sample output:
{
"msg": "success",
"code": 0,
"data": [
{
"roleName": "12345",
"value": "23580",
"ranking": "10"
},
...
]
}
3.6 User 3v3 pvp rating ranking port
Description
- Request user 3v3 pvp rating ranking information
Path
- /global/topList/pvpPoints/3v3
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
topNum | Int | No | Top ranking counts, default 100, max 100 |
Sample input parameters:
topNum=100×tamp=1234567890
Output
Name | Type | Enum | Description |
---|---|---|---|
data | Array | Data | |
> roleName | String | Character name | |
> value | String | Character 3v3 pvp rating | |
> ranking | String | Rank |
Sample output:
{
"msg": "success",
"code": 0,
"data": [
{
"roleName": "12345",
"value": "23580",
"ranking": "10"
},
...
]
}
3.7 User improved fighting capacity ranking port
Description
- Request user ranking information in respect to fighting capacity improvement over a certain period
Path
- /global/topList/fightingImprove
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
topNum | Int | No | Top ranking counts, default 100, max 100 |
Sample input parameters:
topNum=100×tamp=1234567890
Output
Name | Type | Enum | Description |
---|---|---|---|
data | Array | Data | |
> roleName | String | Character name | |
> value | String | Value of fighting capacity improvement | |
> ranking | String | Rank |
Sample output:
{
"msg": "success",
"code": 0,
"data": [
{
"roleName": "12345",
"value": "23580",
"ranking": "10"
},
...
]
}
3.8 User onchain data search port
Description
- Based on user's wallet address, search for onchain data
Path
- /user/chainInfo
Method
- GET
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
address | String | Yes | Wallet address |
Sample input parameters:
address=0xF387a991234785B2D9d8f9826822BeCD367D5678×tamp=1234567890
Output
Name | Type | Enum | Description |
---|---|---|---|
data | Object | Data | |
> minted | String | Did the user mint the NFT (true/false) | |
> deposited | String | Did the user deposit the NFT (true/false) | |
extraData | Object | Other additional data |
Sample output:
{
"msg": "success",
"code": 0,
"data": {
"minted": true,
"deposited": true,
"extraData": {
}
}
}
4 Error Code
code | msg |
---|---|
0 | success |
50001 | Invalid api key |
50002 | Invalid signature |
50003 | invalid requesting method |
50004 | invalid parameters |
50005 | requesting ip not whitelisted |
50006 | invalid timestamp (have not submitted timestamp parameter or requesting time exceeds 5 second) |
50007 | system error (please contact openapi developers) |
50008 | Invalid request |