RESTful style API interface document template

1 Interface name

User registration interface

2 Interface description

  1. User information registration
  2. Users can register by mobile phone number/email
  3. Only one account can be registered with the same mobile phone number/email

3 request address

{apiAddress}/api/user/signup

4 Request method

POST

5 request parameters

5.1 Header parameters

parameter name required type/parameter value illustrate
Content-Type yes application/json request parameter type

5.2 Body parameter

parameter name required type limitation factor illustrate example value
account yes string 1 < length < 50 user account
passcode yes string 1 < length < 50 password
checkCode yes string length = 6 verification code

Note: The encryption method of the password (passcode) is xxxxxx

Other interfaces that need to be called:

interface name interface address Instructions for use
get verification code {apiAddress}/api/common/getCheckCode Obtain the verification code required for registration

5.3 Request example

{
    
    
"account" : 1001,
"passcode" : 123456,
"checkCode" : 1
}

6 Response parameters

6.1 Return parameters

parameter name required type limitation factor illustrate example value
account yes string 1 < length < 50 user account
passcode yes string 1 < length < 50 password
checkCode yes string length = 6 verification code

6.2 Return example

{
    
    
    "code": 200,  // 状态码
    "msg": "成功",  // 提示信息
    "data": null  // 返回内容
}

7 Remarks

For more return error codes, please refer to the return status code table on the homepage

8 Error response code (optional)

error code wrong description reason solution example value
SYSTEMERROR The interface returns an error system timeout Please call the API again with the same parameters. 001

Guess you like

Origin blog.csdn.net/fengling_smile/article/details/121195038