User authorization
General information
This service allows performing the following actions:
- authorizing user (to get session ID);
- closing the current session;
- getting data on the current session.
User authorization
Method request
Request structure
Method address: https://api.dellin.ru/v3/auth/login.json
{ "appkey": "00000000-0000-0000-0000-000000000000", "login": "info@info.ru", "password": "Password1" }
Method address: https://api.dellin.ru/v3/auth/login.xml
<request> <appkey>00000000-0000-0000-0000-000000000000</appkey> <login>info@info.ru</login> <password>Password1</password> </request>
Description of parameters
Request
Request | |||
---|---|---|---|
Parameter | Required | Type | Description |
appkey | Yes | string | Application key. To get the key, register |
login | Yes | string | Personal account login. Either email or phone number can be used as login. Phone number format: "+7XXXXXXXXXX" (12 characters starting with "+7") |
password | Yes | string | Personal account password |
Note:
|
Method response
Response structure
{ "metadata":{ "status":200, "generated_at":"2015-06-18 12:37:28" }, "data":{ "sessionID":"00000000-0000-0000-0000-000000000000" } }
<response> <metadata> <status>200</status> <generated_at>2015-06-18 12:37:28</generated_at> </metadata> <data> <sessionID>00000000-0000-0000-0000-000000000000</sessionID> </data> </response>
Description of parameters
Response
Response | ||
---|---|---|
Parameter | Type | Description |
metadata | object | System information |
metadata.status | integer | Emulated status http-code. If successful, code 200 is returned |
metadata.generated_at | string | Server response date and time. Format: YYYY-MM-DD HH:MM:SS |
data | object | Session data |
data.sessionID | string | Session ID for getting access to Personal account data |
Error handling
The common API errors are used with the method, for errors format description and errors list see Errors of API methods.
Closing the current session
Method request
Request structure
Method address: https://api.dellin.ru/v3/auth/logout.json
{ "appkey":"00000000-0000-0000-0000-000000000000", "sessionID":"00000000-0000-0000-0000-000000000000" }
Method address: https://api.dellin.ru/v3/auth/logout.xml
<request> <appkey>00000000-0000-0000-0000-000000000000</appkey> <sessionid>00000000-0000-0000-0000-000000000000</sessionid> </request>
Description of parameters
Request
Request | |||
---|---|---|---|
Parameter | Required | Type | Description |
appkey | Yes | string | Application key. To get the key, register |
sessionID | Yes | string | Session ID for getting access to Personal account data |
Method response
Response structure
{ "metadata":{ "status":200, "generated_at":"2015-06-18 12:37:28" }, "data":{ "state":"success" } }
<response> <metadata> <status>200</status> <generated_at>2015-06-18 12:37:28</generated_at> </metadata> <data> <state>success</state> </data> </response>
Description of parameters
Response
Response | ||
---|---|---|
Parameter | Type | Description |
metadata | object | System information |
metadata.status | integer | Emulated status http-code. If successful, code 200 is returned |
metadata.generated_at | string | Server response date and time. Format: YYYY-MM-DD HH:MM:SS |
data | object | Success confirmation |
data.state | string | Request status. Possible value - "success" |
Error handling
The common API errors are used with the method, for errors format description and errors list see Errors of API methods.
Data on the current session
Information about the status of the current session may be useв for session resumption before sending a request to API of the personal account.
Method request
Request structure
Method address: https://api.dellin.ru/v3/auth/session_info.json
{ "appkey":"00000000-0000-0000-0000-000000000000", "sessionID":"00000000-0000-0000-0000-000000000000" }
Method address: https://api.dellin.ru/v3/auth/session_info.xml
<request> <appkey>00000000-0000-0000-0000-000000000000</appkey> <sessionid>00000000-0000-0000-0000-000000000000</sessionid> </request>
Description of parameters
Success confirmation
Request | |||
---|---|---|---|
Parameter | Required | Type | Description |
appkey | Yes | string | Application key. To get the key, register |
sessionID | Yes | string | Session ID for getting access to Personal account data |
Method response
Response structure for active session
{ "metadata":{ "status":200, "generated_at":"2015-06-18 12:37:28" }, "data":{ "session":{ "expireTime":"2014-04-12 18:01", "expired":false } } }
<response> <metadata> <status>200</status> <generated_at>2015-06-18 12:37:28</generated_at> </metadata> <data> <session> <expireTime>2014-04-12 18:01</expireTime> <expired>false</expired> </session> </data> </response>
Description of parameters
Response
Response | ||
---|---|---|
Parameter | Type | Description |
metadata | object | System information |
metadata.status | integer | Emulated status http-code. If successful, code 200 is returned |
metadata.generated_at | string | Server response date and time. Format: YYYY-MM-DD HH:MM:SS |
data | Data | Session info |
Data
Parameter | Type | Description |
---|---|---|
session | object | Current session info |
session.expireTime | string | Expiration date and time of the current session. If session is expired then the parameter value is "null". Format: YYYY-MM-DD HH:MM |
session.expired | boolean | Session status. Possible values:
|
Error handling
The common API errors are used with the method, for errors format description and errors list see Errors of API methods.