BlueDragon
Register users or agents, validate passwords, recharge or withdraw, and query user information.
- Base URL
http://52.158.249.79:9991/api/account/account.ashx- Authentication
- MD5 sign (userName + time + secretKey)
- Sections
- 6
API Documentation#
First, the agent account requests an authorization code and key.
For example, AgentTest receives the following:
- Agent: AgentTom
- Key: 369tasay5T93wC95V73Yv (this is the key required for signing)
- Auth Code: pzatretrtGXKUrXQPSBJYP (this is the parameter that must be passed every time)
Common Response Codes#
- -2: Signature error
- -96: IP restricted
- -99: Illegal operation
- -102: Level-up operation; not the agent's superior
- -107: Not a direct agent; operation forbidden
Note: Many fields in the returned JSON are unnecessary, but they are kept for reference!
User or Agent Registration Interface#
URL: http://52.158.249.79:9991/api/account/account.ashx?action=addUser
| Parameter Name | Type | Length | Required | Description | |
|---|---|---|---|---|---|
| action | string | Fixed | Yes | Fixed parameter addUser | |
| agent | string | Non-empty | Yes | The agent of the player (upper level) | |
| PassWd | string | Non-empty | Yes | Player password (length <= 17) | |
| userName | string | Non-empty | Yes | Username | |
| Name | string | Non-empty | Yes | User nickname | |
| Tel | string | Non-empty | Yes | Phone number | |
| Memo | string | Non-empty | Yes | Remarks | |
| UserType | string | Non-empty | Yes | 1 for regular player, 100 for agent level | |
| time | long | Non-empty | Yes | Timestamp (13 digits, System.currentTimeMillis()) | |
| authcode | string | Non-empty | Yes | Authorization code | |
| sign | string | Non-empty | Yes | Signature, calculated as sign=md5((userName+time+secretKey).tolower) |
- When UserType = 1,
userNameis the player account. - When UserType = 100,
userNameis the agent account. userNamemust be unique and cannot be duplicated.
Response
Success:
json
{"code":0,"msg":"successful operation.","success":true,"type":2}Failure:
json
{"code":-102,"msg":"illegal operation. ","success":false,"type":0}If attempting to add the same account again, it will return success with the message "successful operation.cz".
Reference:
- To add an agent account, set UserType = 100.
- To add a player account, set UserType = 1.
Validate Account Password#
URL: http://52.158.249.79:9991/api/account/account.ashx
| Parameter Name | Type | Length | Required | Description |
|---|---|---|---|---|
| action | string | Fixed | Yes | Fixed parameter checklogin |
| userName | string | Non-empty | Yes | Username |
| password | string | Non-empty | Yes | Player new password (length <= 17) DES encrypted |
| pwdtype | int | Password format. Default 0 (plain), 1 (md5 = md5(password.tolower())) | ||
| time | long | Non-empty | Yes | Timestamp (13 digits, System.currentTimeMillis()) |
| authcode | string | Non-empty | Yes | Authorization code |
| sign | string | Non-empty | Yes | Signature, calculated as sign=md5((userName+time+secretKey).tolower) |
Response
Success:
json
{"code":0, "money":10.1,"msg":"" }Failure Codes:
- -1: Account or password error
- -2: Signature error
- -3: Account does not exist
- -99: Illegal operation
Recharge/Withdraw Interface#
URL: http://52.158.249.79:9991/api/account/setScore.ashx
| Parameter Name | Type | Length | Required | Description |
|---|---|---|---|---|
| action | string | Fixed | Yes | setServerScore (for player) or setAgentScore (for agent) |
| orderid | string | Yes | Unique order ID (within 50 characters) | |
| scoreNum | double | Non-empty | Yes | Amount to change (positive for adding, negative for subtracting) |
| userName | string | Non-empty | Yes | Username |
| ActionUser | string | Non-empty | Yes | Operator (who performed the score change) |
| ActionIp | string | Non-empty | Yes | IP address of the person adding/subtracting scores |
| time | long | Non-empty | Yes | Timestamp (13 digits, System.currentTimeMillis()) |
| authcode | string | Non-empty | Yes | Authorization code |
| sign | string | Non-empty | Yes | Signature, calculated as sign=md5((userName+time+secretKey).tolower) |
Response
Success:
json
{"acc":"test001","code":1,"money":"4930.12","msg":"success "}Failure Codes:
- 0: Success
- -1: Order error
- -2: Signature error
- -3: Currently setting score, please wait
- -4: Setting score too frequently, please wait
- -5: Score parameter error
- -6: System error, please wait
- -7: Cannot deduct score while in game
- -8: Insufficient balance
- -9: Account does not exist
- -99: Illegal operation
Simple User Information Query#
URL: http://52.158.249.79:9991/api/account/account.ashx
| Parameter Name | Type | Length | Required | Description |
|---|---|---|---|---|
| action | string | Fixed | Yes | Fixed parameter getUserInfo |
| userName | string | Non-empty | Yes | Username (sn_LoginId) |
| time | long | Non-empty | Yes | Timestamp (13 digits, System.currentTimeMillis()) |
| authcode | string | Non-empty | Yes | Authorization code |
| sign | string | Non-empty | Yes | Signature, calculated as sign=md5((userName+time+secretKey).tolower) |
Response
Success (when code=0):
json
{
"Account": "sex_test18",
"Agent": "Demo",
"MoneyNum": "5001",
"Name": "N/A",
"Redme": "N/A",
"Status": 1,
"Tel": "N/A",
"code": 0,
"ctime": "2020-11-21 00:18:51",
"idx": 24}Failure Codes:
- 0: Success
- -1: Order error
- -2: Signature error
- -102: Level-up, no permission; cannot query accounts not below oneself.
Failure Response:
{"code":-102,"msg":"illegal operation ","success":false,"type":0}This documentation summarizes the API endpoints, required parameters, and expected responses.
