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

API
Главная / API - Deleting objects from address book

Deleting objects from address book

Обновлено 23.04.2020
76 кб

General information

This service allows deleting counterparties, addresses, contact persons and phones from the address book.

Deleting of objects from the address book

Method request

Request example

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

{   
   "appkey":"00000000-0000-0000-0000-000000000000",
   "sessionID":"00000000-0000-0000-0000-000000000000",
   "counteragentIDs":[
      123,
      345
   ],
   "addressIDs":[
      3,
      2,
      1
   ],
   "phoneIDs":[
      1,
      2
   ],
   "contactIDs":[
      1,
      2,
      3
   ]
}

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

<request>
   <appkey>00000000-0000-0000-0000-000000000000</appkey>
   <sessionID>00000000-0000-0000-0000-000000000000</sessionID>
   <counteragentIDs>123</counteragentIDs>
   <counteragentIDs>345</counteragentIDs>
   <addressIDs>3</addressIDs>
   <addressIDs>2</addressIDs>
   <addressIDs>1</addressIDs>
   <phoneIDs>1</phoneIDs>
   <phoneIDs>2</phoneIDs>
   <contactIDs>1</contactIDs>
   <contactIDs>2</contactIDs>
   <contactIDs>3</contactIDs>
</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
counteragentIDsNo
array of integerArray of ID's of counterparties that need to be deleted
addressIDsNo
array of integerArray of ID's of addresses that need to be deleted
phoneIDsNo
array of integerArray of ID's of phone numbers that need to be deleted
contactIDsNo
array of integerArray of ID's of contact persons that need to be deleted

Method response

Response example

{
   "metadata":{
      "status":200,
      "generated_at":"2015-06-18 12:37:28"
   },
   "data":{
      "deleted":{
         "counteragentIDs":[
            123
         ],
         "addressIDs":[
            3,
            2,
            1
         ],
         "contactIDs":[
            1,
            2,
            3
         ],
         "phoneIDs":[
            1,
            2
         ]
      },
      "notDeleted":{
         "counteragentIDs":[
            123
         ],
         "addressIDs":[
            6,
            5,
            4
         ],
         "contactIDs":[
            4,
            5,
            6
         ],
         "phoneIDs":[
            3,
            4
         ]
      }
   }
}
<response>
   <metadata>
      <status>200</status>
      <generated_at>2015-06-18 12:37:28</generated_at>
   </metadata>
   <data>
      <deleted>
         <counteragentIDs>123</counteragentIDs>
         <addressIDs>3</addressIDs>
         <addressIDs>2</addressIDs>
         <addressIDs>1</addressIDs>
         <contactIDs>1</contactIDs>
         <contactIDs>2</contactIDs>
         <contactIDs>3</contactIDs>
         <phoneIDs>1</phoneIDs>
         <phoneIDs>2</phoneIDs>
      </deleted>
      <notDeleted>
         <counteragentIDs>123</counteragentIDs>
         <addressIDs>6</addressIDs>
         <addressIDs>5</addressIDs>
         <addressIDs>4</addressIDs>
         <contactIDs>4</contactIDs>
         <contactIDs>5</contactIDs>
         <contactIDs>6</contactIDs>
         <phoneIDs>3</phoneIDs>
         <phoneIDs>4</phoneIDs>
      </notDeleted>
   </data>
</response>

Description of parameters

Response
Response
ПараметрТипОписание
metadataobjectSystem information
metadata.statusstringEmulated 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 on objects to be deleted from address book
data.deletedDeletedThe list of objects that has been deleted from address book
data.notDeletedDeletedThe list of objects that has not been deleted from address book (since there is no object with the forwarded ID)

Deleted
Deleted
ParameterTypeDescription
counteragentIDsarray of integerArray of counterparties ID's
addressIDsarray of integerArray of addresses ID's
contactIDsarray of integerArray of contact persons ID's
phoneIDsarray of integerArray of phone numbers ID's

Error handling

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