Skip to main content
Basics

Response format

Every endpoint returns HTTP 200. The business result is in the code field of the body. Decide success by code, not by the HTTP status.

{
"code": 200,
"msg": "操作成功",
"type": "SUCCESS",
"data": {}
}
FieldDescription
codeBusiness status code, see below
msgMessage in Simplified Chinese, suitable for showing to users
typeEnum name matching code; omitted by a few endpoints
dataPayload. When there is none, the field is absent (not null)

Status codes​

codetypeMeaning
200SUCCESSSuccess
300WARNValidation failed: bad signature, missing parameter, insufficient balance, wrong code, and so on. The reason is in msg
500ERRORMalformed parameters or a server error
401UNAUTHORIZEDAn endpoint that requires sign-in got no valid X-Auth-Token, or X-App-Code does not match the token
-1001NULL_MOBILEWeChat mini-program sign-in succeeded but the user has no phone number bound. data contains openId; prompt the user to bind a phone number, see WeChat sign-in
tip

Most business failures return code=300 with the reason in msg. Log msg during integration to make troubleshooting easier.