Поиск по сайту

API
Главная / API - User authorization

User authorization

Обновлено 24.05.2018
83 кб

General information

This service allows you to perform the following actions:

  1. To authorize user (to get session ID);
  2. To close the current session;
  3. To get data on the current session.

User authorization 

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/login.json

{
   "appkey": "00000000-0000-0000-000000000000",
   "login": "info@info.ru",
   "password": "Password1"
}

Method address: https://api.dellin.ru/v1/customers/login.xml 

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <login>info@info.ru</login>
   <password>Password1</password>
</request>

Description of parameters

Request
ParameterR*TypeDescription
appkeyYesstring

Application key. To get the key, register

loginYesstringLogin for personal account at dellin.ru
passwordYesstringPassword for personal account at dellin.ru

Method response

Response example

{ 
   "sessionID": "00000000-0000-0000-0000-000000000000" 
}
<response>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
</response>

Description of parameters

Response
ParameterTypeDescription
sessionIDstringSession ID for getting access to the API methods of the personal account at dellin.ru

Error handling

Response example

{
   "errors": "Unauthorized"
}
<response>
   <errors>Unauthorized</errors>
</response>

Closing the current session

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/logout.json 

{
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000"
}

Method address: https://api.dellin.ru/v1/customers/logout.xml 

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
</request>

Description of parameters

Request
ParameterR*TypeDescription
appkeyYesstring

Application key. To get the key, register

sessionIDYesstringSession ID for getting access to the API methods of the personal account at dellin.ru

Method response

Response example

{
   "answer": "ok"
}
<response>
   <answer>ok</answer>
</response>

Description of parameters

Response
ParameterTypeDescription
answerstring

Status of the session closing

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 example

Method address: https://api.dellin.ru/v1/customers/session_info.json 

{
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000"
}

Method address: https://api.dellin.ru/v1/customers/session_info.xml  

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
</request>

Description of parameters

Request
ParameterR*TypeDescription
appkeyYesstring

Application key. To get the key, register

sessionIDYesstring

Session ID for getting access to the API methods of the personal account at dellin.ru

Method response

Response example for active session

{
   "session": {
      "expire_time": "2014-04-12 18:01", 
      "expired": false 
    }
}
<response>
   <session>
      <expire_time>2014-04-12 18:01:45</expire_time>
      <expired>false</expired>
   </session>
</response>

Response example for expired session

{
   "session": {
      "expire_time": null,
      "expired": true
    }
}
<response>
   <session>
      <expire_time></expire_time>
      <expired>true</expired>
   </session>
</response>

Description of parameters

Response
ParameterTypeDescription
sessionobjectCurrent session
expire_timestringExpiration date and time of the current session
expiredbooleanExpiration indicator of the curren session