Answer the question
In order to leave comments, you need to log in
Amo crm api v4 - how to find a contact by custom field?
When using api, at the time of creating a deal + contact + linking a contact to a deal, duplicate contacts are created. How to avoid it?
Trying to find a contact by phone number
$headers = [
'Accept: application/json',
'Authorization: Bearer ' . $access_token
];
$contact_tell = '+7 (911) 111-11-11';
$subdomain = 'xxxx';
// fields
$queryUrlExists = 'https://'.$subdomain.'.amocrm.ru/api/v4/contacts/?fields[223513]='.$contact_tell; //GET
$curl2 = curl_init();
curl_setopt($curl2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl2, CURLOPT_USERAGENT, "amoCRM-API-client/1.0");
curl_setopt($curl2, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl2, CURLOPT_HTTPGET, 1);
curl_setopt($curl2, CURLOPT_URL, $queryUrlExists);
curl_setopt($curl2, CURLOPT_HEADER, false);
$out2 = curl_exec($curl2);
curl_close($curl2);
$result2 = json_decode($out2, true);
echo '<pre>';
print_r($result2);
echo '</pre>';
exit;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question