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

API
Главная / API - Contact details

Contact details

Обновлено 18.01.2022
159 кб

General information

Thу service allows getting the list of contact persons and phone numbers, add and edit information in the list. The entries unused for 6 months are automatically removed from the address book.

It is not possible to add a contact person or a phone number for counterparty that is "anonymous" receiver."Anonymous" receiver - a receiver on whom minimum info was provided.Delovye Linii company allows providing minimum information on the receiver - only name and phone number. In this case SMS with a code is sent to the phone number. The code is used to receive the goods. For more information see the description of Simplified Shipping service on Delovye Linii company website

Getting the list of contact persons and phone numbers

Method request

Request structure

Method address: https://api.dellin.ru/v2/book/contacts.json

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

Method address: https://api.dellin.ru/v2/book/contacts.xml

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <addressID>1</addressID>
</request>

Description of parameters

Request
Request
ParameterRequiredTypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

addressID

Yesinteger

ID of address for which the list of contact persons and phone numbers is required

Method response

Response structure

{
   "metadata":{
      "status":200,
      "generated_at":"2015-06-18 12:37:28"
   },
   "data":{
      "contacts":[
         {
            "id":1,
            "contact":"Иван Иванович Иванов"
         },
         {
            "id":3,
            "contact":"Петр"
         }
      ],
      "lastUpdate":"2019-05-18 17:23:58",
      "phones":[
         {
            "id":123,
            "phoneNumber":"79002350122",
            "phoneFormatted":"+7 (900) 235-01-22",
            "ext":"55677"
         },
         {
            "id":321,
            "phoneNumber":"375127789955",
            "phoneFormatted":"+375 (12) 778-99-55"
         },
         {
            "id":456,
            "phoneNumber":"495778999999999999",
            "phoneFormatted":null,
            "ext":"0890"
         }
      ]
   }
}
<response>
   <metadata>
      <status>200</status>
      <generated_at>2015-06-18 12:37:28</generated_at>
   </metadata>
   <data>
      <contacts>
         <id>1</id>
         <contact>Иван Иванович Иванов</contact>
      </contacts>
      <contacts>
         <id>3</id>
         <contact>Петр</contact>
      </contacts>
      <lastUpdate>2019-05-18 17:23:58</lastUpdate>
      <phones>
         <id>123</id>
         <phoneNumber>79002350122</phoneNumber>
         <phoneFormatted>+7 (900) 235-01-22</phoneFormatted>
         <ext>55677</ext>
      </phones>
      <phones>
         <id>321</id>
         <phoneNumber>375127789955</phoneNumber>
         <phoneFormatted>+375 (12) 778-99-55</phoneFormatted>
      </phones>
      <phones>
         <id>456</id>
         <phoneNumber>495778999999999999</phoneNumber>
         <phoneFormatted />
         <ext>0890</ext>
      </phones>
   </data>
</response>

Description of parameters

Response
Response
ParameterTypeDescription
metadataobjectSystem information
metadata.statusintegerEmulated status http-code. If successful, code 200 is returned
metadata.generatedAtstring

Server response date and time.

Format: YYYY-MM-DD HH:MM:SS

dataData

Contract persons data and phones

Data
Data
ParameterTypeDescription
contactsarray of ContactsArray of contact persons data
contacts.idinteger

Contact person ID

contacts.contactstringContact person full name
lastUpdatestring

Date of information last update

Format: YYYY-MM-DD HH:MM:SS

phonesarray of PhonesArray of phone numbers data
phones.idintegerPhone number ID
phones.phoneNumberstringPhone number (not formatted)
phones.phoneFormattedstringPhone number (formatted). If it is impossible to format it by international standard, then the parameter value is "null"
phones.extstringExtension phone number

Error handling

The common API errors are used with the method, for errors format description and errors list see Errors of API methods.

Contacts creating and editing

Method request

Request example (creating a contact)

Method address: https://api.dellin.ru/v2/book/contact/update.json

{
   "appkey":"00000000-0000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "addressID":4,
   "contact":"Иван"
}

Method address: https://api.dellin.ru/v2/book/contact/update.xml

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <addressID>4</addressID>
   <contact>Иван</contact>
</request>

Request example (editing a contact)

Method address: https://api.dellin.ru/v2/book/contact/update.json

{
   "appkey":"00000000-0000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "contactID":244,
   "contact":"Иван Иванович"
}

Method address: https://api.dellin.ru/v2/book/contact/update.xml

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <contactID>244</contactID>
   <contact>Иван Иванович</contact>
</request>

Description of parameters

Request
Request
ParameterRequiredTypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

addressID

No*integer

ID of the address for which it is necessary to add a new contact.

*If creating a contact, the parameter is required. If editing a contact, the parameter is not used

contactIDNo*integer

ID of the contact that needs to be edited.

*If editing a contact, the parameter is required. If creating a contact, the parameter is not used

contactYesstringContact person full name

Method response

Response structure

{
   "metadata":{
      "status":200,
      "generated_at":"2015-06-18 12:37:28"
   },
   "data":{
      "state":"new",
      "contactID":244
   }
}
<response>
   <metadata>
      <status>200</status>
      <generated_at>2015-06-18 12:37:28</generated_at>
   </metadata>
   <data>
      <state>new</state>
      <contactID>244</contactID>
   </data>
</response>

Description of parameters

Response
Response
ParameterTypeDescription
metadataobjectSystem information
metadata.statusintegerEmulated status http-code. If successful, code 200 is returned
metadata.generated_atstring

Server response date and time.

Format: YYYY-MM-DD HH:MM:SS

dataobjectInformation about the created/edited contact
data.statestring

Contact status. Possible values:

  • "existing" - the existing contact has been edited;
  • "new" - a new contact has been created
data.contactIDinteger

ID of the created/edited contact

Error handling

The common API errors are used with the method, for errors format description and errors list see Errors of API methods.

Phone numbers adding and editing

Method request

Request example (adding a phone number)

Method address: https://api.dellin.ru/v2/book/phone/update.json

{
   "appkey":"00000000-0000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "addressID":4,
   "phoneNumber":"79002350122",
   "ext":"0867"
}

Method address: https://api.dellin.ru/v2/book/phone/update.xml

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <addressID>4</addressID>
   <phoneNumber>79002350122</phoneNumber>
   <ext>0867</ext>
</request>

Request example (editing a phone number)

Method address: https://api.dellin.ru/v2/book/phone/update.json

{
   "appkey":"00000000-0000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "phoneID":214,
   "phoneNumber":"79002350122",
   "ext":"0867"
}

Method address: https://api.dellin.ru/v2/book/phone/update.xml

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <phoneID>214</phoneID>
   <phoneNumber>79002350122</phoneNumber>
   <ext>0867</ext>
</request>

Description of parameters

Request
Request
ParameterRequiredTypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

addressID

No*integer

ID of address for which it is necessary to add a phone number.

*If adding a phone number, the parameter is required. If editing a phone number, the parameter is not used

phoneIDNo*integer

ID of phone number that needs to be edited.

*If editing a phone number, the parameter is required. If adding a phone number, the parameter is not used

phoneNumberYesstring

Phone number. 

Only digits and plus sign are allowed (plus can only be passed at the beginning of the string that starts with 7 or 375)

extNostringExtension phone number. Maximum length - 5 digits

Method response

Response structure

{
   "metadata":{
      "status":200,
      "generated_at":"2015-06-18 12:37:28"
   },
   "data":{
      "state":"existing",
      "phoneID":214
   }
}
<response>
   <metadata>
      <status>200</status>
      <generated_at>2015-06-18 12:37:28</generated_at>
   </metadata>
   <data>
      <state>existing</state>
      <phoneID>214</phoneID>
   </data>
</response>

Description of parameters

Response
Response
ParameterTypeDescription
metadataobjectSystem information
metadata.statusintegerEmulated status http-code. If successful, code 200 is returned
metadata.generated_atstring

Server response date and time.

Format: YYYY-MM-DD HH:MM:SS

dataobjectInformation about the created/edited phone number
data.statestring

ID of address for which addition of the contact person is done

Phone number status. Possible values:

  • "existing" - the existing phone number has been edited;
  • "new" - a new phone number has been created
data.phoneIDintegerID of the created/edited phone number

Error handling

The common API errors are used with the method, for errors format description and errors list see Errors of API methods.