/api/login
Use this interface to login.
Prototype
Protocol |
HTTP/HTTPS POST |
URL |
ip[:port]/api/login |
Content-Type |
Request: Content-Type: application/json Response: Content-Type: application/json |
Request Body
Parameter |
Description |
id |
Username |
pass |
MD5 Password |
Request Example
POST /api/login HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json;charset=utf-8
Content-Length: xx
{
"id":"test",
"pass":"c4ca4238a0b923820dcc509a6f75849b"
}
Response Parameters
Parameter |
Description |
Content-Type |
Value: 'application/json; charset=UTF-8' |
Response Body
Parameter |
Description |
result |
Result code |
is-hardware |
Whether it is a hardware version |
token |
The key value pointed to by mwcloud-sid |
user |
User information |
Parameter |
Description |
name |
User name |
id |
User ID |
group-name |
Group name |
permission |
Permission mask |
type |
Group type, 1 repsents admin, 2 repsents usr, 4 repsents viewer, 8 repsents custom |
Error Codes
Error Codes |
Description |
MW_STATUS_NOT_EXIST |
User does not exist. |
MW_STATUS_MISMATCH |
Password incorrect. |
Response Example
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
content-length: xx
{
"is-hardware": false,
"result": 0,
"token": "xxxx",
"user": {
"group-name": "Admin",
"id": 1,
"name": "Admin",
"permission": 4294967295,
"type": 1
}
}