Authorisation

To authorise, call the auth function (https://<DOMAIN>/api/auth/) with the parameters login (user login) and password (user password).

Parameters:

  • login - user login
  • password - user password

Response:

  • status
    • OK - authorisation was successful
    • ERROR - user with the specified login/password does not exist
  • response.message - status explanation in case of error
  • response.token - token for further authorisation for calling other functions (length 32 characters).

Token lifetime is 600 seconds.

Attention!

Examples of GET queries have been removed as they are not secure and can be intercepted via MITM attacks or packet sniffing when using the HTTP protocol.

The GET query functionality remains, but may be removed in future releases.

It is strongly recommended to use exclusively JSON POST queries with Content-type: application/json header

Example of POST query to  http://<DOMAIN>/api/auth/

POST http://<DOMAIN>/api/auth/
Content-Type: application/json

{
	"login": "api",
	"password": "q4lrfb3"
}


Example of a successful authorisation response:

{
	"status":"OK",
	"response": {
		"token": "3199c39700714eec4f6ada0b4242335b"
	}
}


Important!!!

The token parameter must be passed with the query when calling any API function except auth (in the format of the corresponding data transfer type (POST, GET, PUT)).


Example of sending data by POST query to http://<DOMAIN>/api/<SOME_FUNC>/

POST http://<DOMAIN>/api/<SOME_FUNC>/
Content-Type: application/json

{
	"token": "<TOKEN>",
	"param_1": "a",
	"param_2": "b"
}