Those endpoints are designed to be user for communication between backend and frontend.
- POST
api/register
- Input:
{
"username": "string/email",
"password": "string"
}
- Returns token required to access all endpoints (Authorization: Bearer)
- POST
api/login_check
- Input:
{
"username": "string",
"password": "string"
}
- Output:
{
"token": "string/JWT Token",
"refresh_token_expiration": "unix timestamp"
}
- Get
api/devices/{id}
- Output:
{
"id": "string/uuid",
"name": "string",
"active": "boolean",
"shortId": "string",
'password': 'string',
"sensors": [
{
"id": "string/uuid",
"name": "string",
"active": "boolean"
}
]
}
- Returns list of user's active devices with active sensors
- GET
api/sensors
- Output:
{
"id": "string/uuid",
"name": "string",
"sensors": [
{
"id": "string/sensor uuid",
"name": "string"
}
]
}
- Returns full list of user's devices with
- GET
api/sensors/full_list
- Output:
[
{
"id": "string/uuid",
"name": "string",
"active": "boolean",
"shortId": "string",
"password": "string"
}
]
- Changes device's
name
parameter - POST
api/sensors
- Input:
{
"name": "string(25)"
}
- Output:
[
{
"id": "string/uuid",
"name": "string",
"active": false,
"shortId": "string",
"password": "string",
"sensors" : []
}
]
- Changes device's
active
parameter - GET
api/sensors/{id}/change_active
- Input:
{
"active": "boolean"
}
- Output:
[
{
"id": "string/uuid",
"name": "string",
"active": "boolean",
"shortId": "string",
"password": "string",
"sensors" : [
{
"id": "string/sensor uuid",
"name": "string",
"active": "boolean"
}
]
}
]
- Changes device's
name
parameter - GET
api/sensors/{id}/change_name
- Input:
{
"name": "string(25)"
}
- Output:
[
{
"id": "string/uuid",
"name": "string",
"active": "boolean",
"shortId": "string",
"password": "string",
"sensors" : [
{
"id": "string/sensor uuid",
"name": "string",
"active": "boolean"
}
]
}
]