-
Notifications
You must be signed in to change notification settings - Fork 1
Terminal API
API uses a WebSocket connection to communicate by messages in JSON-format. Each message is an array with one or more messages, where each message has the next format:
{
"topic": string with the message topic
"data": message data, format depends on message topic
}
The first message from a newly connected client to the service must be a message with the authorization request. Any other messages may be sent only after successful authorization. If the service will receive any message before - the client connection will be terminated.
The message has topic auth
. Client message provides accounts credentials to requests the authorization process for the connection. The service message reports about authorization status. If the authorization process will be failed for any reason - service will close client connection.
{
"topic": "auth",
"data": {
"login": `string with user login`,
"password": string with user password
}
}
{
"topic": "auth",
"data": {
"success": true, if the connection is authenticated, or false if not
}
}
Request:
[ { "topic": "auth", "data": { "login": "guest", "password": "Qwerty123" } } ]
Response:
[ { "topic": "auth", "data": { "success": true } } ]