REST APIs
All Platform Portal functionality is built on REST APIs that developers can call directly to access resources and control their devices programmatically.
Authentication
GET /auth/ping
Ping the server to see if it is still alive.
-
Response
200 OK-
Body
pong
-
GET /auth/agentinfo
Get the agent information. (since v1.8.1)
-
Response
200 OKRequest Successfully
-
Body
{
"version": "v1.8.1"
}
-
GET /auth/version
Get the API version. (since v1.7.1)
-
Response
200 OKRequest Successfully
-
Body
{
"version":1.2
}
-
GET /auth/token{?m}
Get with the OS or the admin account and return the JWT token if the user is valid.
A request contains a header field in the form of Authorization: Basic , where credentials are the Base64 encoding of username and password joined by a single colon :
username:password => (base64) => dXNlcm5hbWU6cGFzc3dvcmQ=
(since v1.7.1, API version 1.1)
-
URI Parameters
m
number(optional) - User account type. (since v1.8.1, API version 1.2)0: OS account (default)2:adminaccount (default password:p@ssw0rd, must be changed after login)
-
Request Header
Authorization: Basic -
Response
200 OKLogin Successfully
-
Body
{
"code": 200
"expire":"20XX-XX-XXT14:08:33+08:00"
"token": ""
} -
Cookie (if available)
Secure and HttpOnly cookies
Key: jwt
Value:
-
-
Response
401 UnauthorizedLogin Failed
{
"Code": 401,
"Message": ""
}