Skip to content

Authentication

Zijun Chen edited this page Sep 18, 2018 · 2 revisions

User Authentication

Request

Required Parameters
Parameter Optional Type Description
token - String user token from log_in

Example of calling v1/user/info

v1/user/info?token=eyJhbGciOiJ......6rY7GEfg-c

Response

Possible Error Codes
Error Code Description
-1 Authorisation error

Failure Example

{
    "code": -1,
    "msg": "Authorization error",
    "detail": "Failed to parse the token"
}

Slave Authentication

Request

Required Parameters
Parameter Optional Type Description
sid - String a unique id of the slave
key - String slave key

Example of calling v1/slave/init

v1/slave/init?sid=slave001&key=secretslavekey

Response

Possible Error Codes
Error Code Description
-1 Authorisation error

Failure Example

{
    "code": -1,
    "msg": "Authorization error",
}
Clone this wiki locally