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": ""
}
POST /auth/login{?m}
Log in with the OS or admin account and return the JWT token if the user is valid.
-
URI Parameters
m
number(optional) - User account type. (since 1.8.1, API version 1.2)0: OS account (default)2:adminaccount (default password:p@ssw0rd, must be changed after login)
-
Request body
{
"username": "your_username",
"password": "your_password"
} -
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": ""
}
POST /auth/logout
Log out and clear the cookie.
-
Response
200 OK{
"code": 200
}
GET /auth/certificate
Download the JWT certificate file in the PEM format.
-
Response
200 OKHeaders
Content-Type: application/octet-stream
Content-Description: File Transfer
Content-Transfer-Encoding: Binary
Content-Disposition: attachment; filename=cert.pem.crt
PUT /auth/user/admin/password
Change the admin’s password. (since 1.8.1, API version 1.2)
-
Request Headers
Log in with the
adminaccount to get the JWT token (tokenfield from the response body).Authorization: Bearer -
Request Body
{
"old": "",
"new": "",
} -
Response
200 OK -
Response
400 Bad Request{
"code": 400, // optional
"message": ""
} -
Response
401 Unauthorized{
"code": 401,
"message": ""
} -
Response
422 Unprocessable EntityThe request has been applied, but the request body is invalid.
{
"errors": {
"validator": ""
}
}
DELETE /auth/user/admin/password
Reset the admin’s password to the default value (p@ssw0rd). (since 1.8.1, API version 1.2)
-
Request Headers
Log in with the
adminaccount to get the JWT token (tokenfield from the response body).Authorization: Bearer -
Response
200 OK -
Response
400 Bad Request{
"code": 400, // optional
"message": ""
} -
Response
401 Unauthorized{
"code": 401,
"message": ""
}
H/W Monitor
GET /platform/api/hwmon
Get all H/W Monitor data, including Temperature, Voltage, Current, and Fan Speed.
-
Request Headers
Log in with your OS account or the
adminaccount to get the JWT token (tokenfield from the response body).Authorization: Bearer -
Response
200 OK{
"temperature": [
{
"name": "CPU",
"value": "50.1",
"unit": "Celsius"
}
],
"voltage": [
{
"name": "VCore",
"value": "0.92",
"unit": "Volt"
},
{
"name": "12V",
"value": "11.86",
"unit": "Volt"
}
],
"current": [
{
"name": "OEM0",
"value": "0.54",
"unit": "A"
}
],
"fanspeed": [
{
"name": "FAN0",
"value": "1234",
"unit": "RPM"
}
]
} -
Response
401 Unauthorized{
"Code": 401,
"Message": ""
} -
Response
404Not supported or no available data.
GET /platform/api/hwmon (SSE)
Get all H/W Monitor data, including Temperature, Voltage, Current, and Fan Speed via Server-Sent Events (SSE).
-
EventStream
event: message
data: {"current":[{"name":"OEM0","value":0.34, "unit":"A"}],"temperature":[{"name":"CPU","value":41, "unit":"Celsius"}],"voltage":[{"name":"Vcore", "value":0.92,"unit":"Volt"},{"name":"12V","value":11. 86,"unit":"Volt"},{"name":"5V Standby","value":4.95, "unit":"Volt"},{"name":"CMOS Battery","value":3.05, "unit":"Volt"}]}
GET /platform/api/hwmon/temperatures
Get H/W Monitor temperature data.
-
Request Headers
Log in with your OS account or the
adminaccount to get the JWT token (tokenfield from the response body).Authorization: Bearer -
Response
200 OK```json
[ { "name": "CPU", "value": 40, "unit": "Celsius" }, ... ]
-
Response
401 Unauthorized{
"Code": 401,
"Message": ""
} -
Response
404Not supported or no available data.
GET /platform/api/hwmon/voltages
Get H/W Monitor voltage data.
-
Request Headers
Log in with your OS account or the
adminaccount to get the JWT token (tokenfield from the response body).Authorization: Bearer -
Response
200 OK```json
[ { "name": "Vcore", "value": 0.92, "unit": "Volt" }, ... ]
-
Response
401 Unauthorized{
"Code": 401,
"Message": ""
} -
Response
404Not supported or no available data.
GET /platform/api/hwmon/currents
Get H/W Monitor current data.
-
Request Headers
Log in with your OS account or the
adminaccount to get the JWT token (tokenfield from the response body).Authorization: Bearer -
Response
200 OK```json
[ { "name": "OEM0", "value": 0.54, "unit": "A" }, ... ]
-
Response
401 Unauthorized{
"Code": 401,
"Message": ""
} -
Response
404 Not FoundNot supported or no available data.
GET /platform/api/hwmon/fanspeeds
Get H/W Monitor fan speed data.
-
Request Headers
Log in with your OS account or the
adminaccount to get the JWT token (tokenfield from the response body).Authorization: Bearer -
Response
200 OK```json
[ { "name": "FAN0", "value": 1234, "unit": "RPM" }, ... ]
-
Response
401 Unauthorized{
"Code": 401,
"Message": ""
} -
Response
404 Not FoundNot supported or no available data.
Platform
GET /platform/api/ping
Ping the server to see if it is still alive.
-
Response
200 OK-
Body
pong
-
GET /platform/api/agentinfo
Get the agent information. (since v0.14.1)
-
Response
200 OKRequest Successfully
-
Body
{
"version": "v0.14.1"
}
-
Portal
GET /api/ping
Ping the portal-service server to see if it is still alive.
-
Response
200 OK-
Body
pong
-
GET /api/agentinfo
Get the portal-service agent information. (since v0.14.1)
-
Response
200 OKRequest Successfully
-
Body
{
"version": "v0.14.1"
}
-
GET /api/irtm/ping
Ping the iFactory RTM server to see if it is still alive.
-
Response
200 OK-
Body
pong
-