Skip to content

updateContacts method

updateContacts

Updates information about existing contacts. Lets you update any contact parameter (except the ID). The response returns an array of IDs of the updated contacts and/or an array of IDs of the contacts that were not updated, with a description of the reason. Method: POST Format: JSON URL: https://api.r7k12.com/{{TOKEN}}/updateContacts Parameters: Table 1 Content-type: application/json Table 1

Parameter Type Required Description
id string Yes Unique contact ID in the CRM.
name string No Contact name
phone array [string] No Array of the contact's new phone numbers to be added
email array [string] No Array of the contact's e-mail addresses to be added
leads array [string] No Array of IDs of the deals this contact belongs to that need to be added

Request body example:

[
 {
   "name": "Name update",
   "id": "1"
 },
 {
  "id": "2",
   "phone": [
     "380441234560"
   ]
 },
 {
   "id": "3",
   "email": [
     "[email protected]"
   ],
   "leads": [
     "679"
   ]
 }
]

Response example:

{
 "upload" : [1,2,3],
 "notUpdate" : [,
   {
     "id" : 5,
     "message" : "Контакт с указанным идентификатором не существует"
   }
 ]
}

Script example (PHP):

define('TOKEN','XXXXXXXXX');
@file_get_contents(
   'https://api.r7k12.com/'.TOKEN.'/updateContacts',
   0,
   stream_context_create(
       [
           'http' => [
               'method' => "POST",
               'header' => "Content-Type: application/json\r\n",
               'content' => json_encode(
                   [
   [
       'name' => 'Name update',
       'id' => '1'
   ],
   [
       'id' => '2',
       'phone' => [
           '380441234560'
       ]
   ],
   [
       'id' => '3',
       'email' => [
           '[email protected]'
       ],
       'leads' => [
           '679'
       ]
   ]
]
               )
           ]
       ]
   )
);