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 NameTypeLengthRequiredDescription
actionstringFixedYesFixed parameter addUser
agentstringNon-emptyYesThe agent of the player (upper level)
PassWdstringNon-emptyYesPlayer password (length <= 17)
userNamestringNon-emptyYesUsername
NamestringNon-emptyYesUser nickname
TelstringNon-emptyYesPhone number
MemostringNon-emptyYesRemarks
UserTypestringNon-emptyYes1 for regular player, 100 for agent level
timelongNon-emptyYesTimestamp (13 digits, System.currentTimeMillis())
authcodestringNon-emptyYesAuthorization code
signstringNon-emptyYesSignature, calculated as sign=md5((userName+time+secretKey).tolower)
  • When UserType = 1, userName is the player account.
  • When UserType = 100, userName is the agent account.
  • userName must 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 NameTypeLengthRequiredDescription
actionstringFixedYesFixed parameter checklogin
userNamestringNon-emptyYesUsername
passwordstringNon-emptyYesPlayer new password (length <= 17) DES encrypted
pwdtypeintPassword format. Default 0 (plain), 1 (md5 = md5(password.tolower()))
timelongNon-emptyYesTimestamp (13 digits, System.currentTimeMillis())
authcodestringNon-emptyYesAuthorization code
signstringNon-emptyYesSignature, 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 NameTypeLengthRequiredDescription
actionstringFixedYessetServerScore (for player) or setAgentScore (for agent)
orderidstringYesUnique order ID (within 50 characters)
scoreNumdoubleNon-emptyYesAmount to change (positive for adding, negative for subtracting)
userNamestringNon-emptyYesUsername
ActionUserstringNon-emptyYesOperator (who performed the score change)
ActionIpstringNon-emptyYesIP address of the person adding/subtracting scores
timelongNon-emptyYesTimestamp (13 digits, System.currentTimeMillis())
authcodestringNon-emptyYesAuthorization code
signstringNon-emptyYesSignature, 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 NameTypeLengthRequiredDescription
actionstringFixedYesFixed parameter getUserInfo
userNamestringNon-emptyYesUsername (sn_LoginId)
timelongNon-emptyYesTimestamp (13 digits, System.currentTimeMillis())
authcodestringNon-emptyYesAuthorization code
signstringNon-emptyYesSignature, 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.