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 requests 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 request functionality remains, but may be removed in future releases.
It is strongly recommended to use exclusively JSON POST requests with Content-type: application/json header
Example of POST request 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 request 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 request to http://<DOMAIN>/api/<SOME_FUNC>/
POST http://<DOMAIN>/api/<SOME_FUNC>/ Content-Type: application/json { "token": "<TOKEN>", "param_1": "a", "param_2": "b" }
Add Comment