Skip to content

Login User API



POST /login

The request will allow the user to log into the system and share their device ID to receive all other requests from other users or events.

Possible authorization request options:

{
"organization_id": "680a2fae96cc69d78861f101",
"login": "login_u1",
"password": "u1_password",
"device_id": "device_u1"
}

All variations of the query will have the same response:

{
"user": {
"_id": "63480e68f4794709f802a2fa",
"login" :"login_u1",
"created_at": "2022-10-13T13:11:04.447Z",
"updated_at": "2022-10-13T13:11:04.447Z"
},
"access_token": "...",
"expired_at": timestamp_in_ms
}
  • expired_at - the time when the access_token will expire

After receiving the access_token, the client must send a request to connect the socket to the server and link it to the current access_token:

{
"request": {
"connect": {
"token": "access_token",
"device_id": "device_u1"
},
"id": "RequestId"
}
}
{ "response": { "id": "RequestId", "success": true } }

Old Websocket Requests Deprecated

Section titled “Old Websocket Requests ”
{
"request": {
"user_login": {
"organization_id": "680a2fae96cc69d78861f101",
"login": "user_1",
"password": "user_paswword_1",
"device_id": "xxx-yyy-zzz"
},
"id": "RequestId"
}
}
{
"response": {
"id": "RequestId",
"user": {
"_id": "63480e68f4794709f802a2fa",
"created_at": "2022-10-13T13:11:04.447Z",
"updated_at": "2022-10-13T13:11:04.447Z",
"login" :"user_1"
},
"token": "..."
}
}

Later, the subsequent logins can be done via token:

{
"request": {
"user_login": {
"token": "..."
},
"id": "RequestId"
}
}
{ "response": { "id": "RequestId", "user": { ... }, "token": "..." } }