文章目录
Login
API instruction
login function
Request
- Method: GET/POST
- URL:
users/login.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
user | alphabetic string | user name(necessary parameter) |
password | alphabetic string | password(necessary parameter) |
Response
- Body
right return of user and password
{
"result": "ok",
"data": {
"token": "21232f297a57a5a743894a0e4a801fc3",
"alias": "Admin"
}
}
failure login return:
{ "result": "error", "msg": "1511"}
- return instruction:
field | type | instruction |
---|---|---|
token | alphabetic string | authentication token |
alias | alphabetic string | user name |
test interface:
http://192.168.2.123/api/users/login.json?user=admin&password=admin
Gain user list
API instruction
Lists the current list of HTTP logins
Request
- Method: GET/POST
- URL:
users/list.json
- Headers:
- submit parameter: no
Response
- Body
{
"result": "ok",
"data": [
{
"id": "admin",
"create_time": "1970-01-01 00:00:00",
"alias": "Admin"
}
]
}
test interface:
http://192.168.2.123/api/users/list.json
Increase user
API instruction
increase HTTP logins
Request
- Method: GET/POST
- URL:
users/add.json
- Headers:
- submet parameter:
field | type | instruction |
---|---|---|
id | alphabetic string | new user name(necessary parameter) |
alias | alphabetic string | user name(necessary parameter) |
password | alphabetic string | password (necessary parameter) |
Response
- Body
{ "result": "ok"}
test interface:
http://192.168.2.123/api/users/add.json?id=admin1&alias=hahaha&password=test
Modify the user information
API instruction
Modify the password and password of HTTP logins
Request
- Method: GET/POST
- URL:
users/modify.json
- Headers:
-submit parameter:
field | type | instruction |
---|---|---|
id/username | alphaetic string | new user name(necessary parameter) |
alias | alphabetic string | user name(necessary parameter) |
password | alphabetic string | password (necessary parameter) |
Response
- Body
{ "result": "ok"}
test interface:
http://192.168.2.123/api/users/modify.json?id=admin&alias=hahaha&password=test111
Delet user
API instruction
delete HTTP logins
Request
- Method: GET/POST
- URL:
users/remove.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
ids | alphaetic string or arrays | the user name and arrays need to be deleted(necesaary parameter) |
Response
- Body
{ "result": "ok"}
test interface:
http://192.168.2.123/api/users/remove.json?ids[]=admin1&ids[]=admin122