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

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

Contact details

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

General information

This service allows you to get the list of contact persons and phone numbers, add and edit information in the list. Adding contact persons and phone numbers is available only for counterparties that are not anonymous receivers.

Getting the list of contact persons and phone numbers

Method request

Request example

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

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

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

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

Description of parameters

Request
ParameterR*TypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

addressID

Yesstring

ID of address on which the list of contact persons and phone numbers is requiered

Method response

Response example

[  
   {  
      "contacts":[  
         {  
            "id":"1",
            "contact":"Иван Иванович Иванов"
         },
         {  
            "id":"3",
            "contact":"Петр"
         }
      ],
      "lastUpdate": "2017-05-18T17:23:58.000+03:00",
      "phones": [
         {
            "id":"123",
            "phone":"79002350122", 
            "phoneFormatted":"+7 (900) 235-01-22", 
            "addNumber":"55677"
         },
         { 
            "id":"321",
            "phone":"375127789955", 
            "phoneFormatted":"+375 (12) 778-99-55"
         },
         { 
            "id":"456", 
            "phone":"495778999999999999", 
            "addNumber":"0890"
         }
      ]
   }
]
<response>
   <contacts>
      <id>1</id>
      <contact>Иван Иванович Иванов</contact>
   </contacts>
   <contacts>
      <id>3</id>
      <contact>Петр</contact>
   </contacts>
   <lastUpdate>2017-05-18T17:23:58.000+03:00</lastUpdate>
   <phones>
      <id>123</id>
      <phone>79002350122</phone>
      <phoneFormatted>+7 (900) 235-01-22</phoneFormatted>
      <addNumber>55677</addNumber>
   </phones>
   <phones>
      <id>321</id>
      <phone>375127789955</phone>
      <phoneFormatted>+375 (12) 778-99-55</phoneFormatted>
   </phones>
   <phones>
      <id>456</id>
      <phone>495778999999999999</phone>
      <addNumber>0890</addNumber>
   </phones>
</response>

Description of parameters

Response
ParameterTypeDescription
contactsarray of Response.ContactsArrray of contact persons
phonesarray of Response.Phones

Arrray of phone numbers

lastUpdatestringDate of information last update

Response.Contacts
ParameterTypeDescription
idstringContact person ID
contactstring

Contact person full name

Response.Phones
ParameterTypeDescription
idstringPhone number ID
phonestring

Phone number (not formatted)

phoneFormattedstring

Phone number (formatted). It's missing if it is impossible to format it by international standard

addNumberstringExtension phone number

Contact persons adding and editing

Contact person adding

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/book/contacts/update.json

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

Method address: https://api.dellin.ru/v1/customers/book/contacts/update.xml

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <addressid>4</addressid>
   <contact>Иван</contact>
</request>
Description of parameters
Request
ParameterR*TypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

addressID

YesstringID of address for which addition of the contact person is requiered
contactYesstringContact person full name

Method response

Response example
{  
   "success":{  
      "addressID":"4",
      "personID":"244"
   }
}
<response>
   <success>
      <addressid>4</addressid>
      <personid>244</personid>
   </success>
</response>
Description of parameters
Response
ParameterTypeDescription
successobjectInformation about the added contact person
success.addressIDstringID of address for which addition of the contact person is done
success.personIDstringID of added contact person

Error handling

In case of errors, response will contain the names of parameters that caused errors with errors description. Error description in example below: "required parameter is not passed".

Response example
{  
   "errors":{  
      "contact":"не передано обязательное поле"
   }
}
<response>
   <errors>
      <contact>не передано обязательное поле</contact>
   </errors>
</response>

Contact person editing

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/book/contacts/update.json

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

Method address: https://api.dellin.ru/v1/customers/book/contacts/update.xml

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <personid>244</personid>
   <contact>Иван Иванович</contact>
</request>
Description of parameters
Request
ParameterR*TypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

personID

YesstringID of contact person that needs to be edited
contactYesstringNew contact person full name
Responses of method when adding and editing contact person are similar.

Phone numbers adding and editing

Phone number adding

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/book/phones/update.json

{
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "addressID":"4",
   "phoneNumber":"+7 (900) 235-01-22",
   "addNumber":"0867"
}

Method address: https://api.dellin.ru/v1/customers/book/phones/update.xml

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <addressid>4</addressid>
   <phonenumber>+7 (900) 235-01-22</phonenumber>
   <addnumber>0867</addnumber>
</request>
Description of parameters
Request
ParameterR*TypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

addressID

YesstringID of address for which addition of the phone number is requiered
phoneNumberYesstring

Phone number

addNumberNostringExtension phone number. Maximum length - 5 symbols

Method response

Response example
{  
   "success":{  
      "addressID":"4",
      "phoneID":"214"
   }
}
<response>
   <success>
      <addressid>4</addressid>
      <phoneid>214</phoneid>
   </success>
</response>
Description of parameters
Response
ParameterTypeDescription
successobjectInformation about the added phone number
success.addressIDstringID of address for which addition of the contact person is done
success.phoneIDstringPhone number ID

Error handling

In case of errors, response will contain the names of parameters that caused errors with errors description. Error description in example below: "required parameter is not passed".

Response example
{  
   "errors":{  
      "phoneNumber":"не передано обязательное поле"
   }
}
<response>
   <errors>
      <phoneNumber>не передано обязательное поле</phoneNumber>
   </errors>
</response>

When trying to add a phone number for anonymous receiver, you will get the following error message. Error description in example below: "Adding of phone numbers for simplified shipping counterparties is prohibited".

Response example
{  
   "errors":{  
      "phoneNumber":"Запрещено добавление телефонных номеров для адреса контрагента по упрощённой отправке"
   }
}
<response>
   <errors>
      <phoneNumber>Запрещено добавление телефонных номеров для адреса контрагента по упрощённой отправке</phoneNumber>
   </errors>
</response>

Phone number editing

Method request

Request example

Method address: https://api.dellin.ru/v1/customers/book/phones/update.json

{
   "appkey":"00000000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "phoneID":"214",
   "phoneNumber":"+7 (900) 235-01-22",
   "addNumber":"0867"
}

Method address: https://api.dellin.ru/v1/customers/book/phones/update.xml

<request>
   <appkey>00000000-0000-0000-000000000000</appkey>
   <sessionid>00000000-0000-0000-0000-000000000000</sessionid>
   <phoneid>214</phoneid>
   <phonenumber>+7 (900) 235-01-22</phonenumber>
   <addnumber>0867</addnumber>
</request>
Description of parameters
Request
ParameterR*TypeDescription
appkeyYesstringApplication key. To get the key, register

sessionID

YesstringTo get the session ID, use the User Authorization method

phoneID

YesstringID of phone number that needs to be edited
phoneNumberYesstring

New phone number

addNumberNostringNew extension phone number. Maximum length - 5 symbols
Responses of method when adding and editing phone numbers are similar.