Add a user
1. API Description
This API is used to add a user.
Request mode: POST [ip]/api/user/add
Administrator Rights | Logged-in |
---|---|
Yes | Yes |
2. Input Parameters
Name | Required | Type | Description |
---|---|---|---|
username | Yes | String | The user name |
password | Yes | String | The password which is encrypted with sha256 |
3. Output Parameters
Name | Type | Description |
---|---|---|
status | Int | Status code |
code | String | Status description |
4. Example
Adding a user.
Input Example
{
"username":"test",
"password":"c4ca4238a0b923820dcc509a6f75849b"
}
Output Example
{
"status": 0,
"code": "Success"
}
5. Error Code
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
Status | Definition | Description |
---|---|---|
7 | MW_STATUS_INVALID_ARG | The parameters are missing |
31 | NOT_PERMITTED | Only administrators have permission |
41 | CONSTRAINT_VIOLATION | The existed user |