Skip to content

getContacts method

getContacts

The method lets you get a list of contacts, including those created via the R7K12 service. The method returns no more than 10000 records per call; each response includes the “totalResult” parameter with the total number of results. Method: GET URL: https://api.r7k12.com/{{TOKEN}}/getContacts Parameters: Table 1 Table 1

Parameter Type Required Description
id string No Unique contact ID in the CRM. When this parameter is used, the response will contain the contact with the specified ID (if it exists).
lastModified string No Date of the last change of the contact. Format: - YYYY-MM-DD HH:MM:SS - YYYY-MM-DD. If this parameter is specified, the response will include only the contacts that were changed/created after the specified date.
fields array [string] No List of fields to return in the response. If the parameter is not set, only IDs are returned. Available fields: - id - contact ID - name - contact name - phone - array of phone numbers - email - array of email addresses - leads - array of deal IDs - dateCreate - creation date (UNIX) - lastModified - change date (UNIX)
limit integer No Number of records to return in the result (default “10000”)
page integer No Number of the page to return (default “1”)

Request example:

define('TOKEN','XXXXXXXXX');
$data = @file_get_contents(
   'https://api.r7k12.com/'.TOKEN.'/getContacts?'.
   http_build_query(
       [
           'fields' => [
               'id',
               'phone',
               'leads'
           ],
           'limit' => 1
       ]
   )
);

Response:

{
 "page" : 1,
 "totalResult": 100,
 "data": [
   {
     "id" : "43",
     "phone" : [
       "380441234567",
       "380503215476"
     ],
     "leads" : [
       "1"
     ]
   }
 ]
}