Answer the question
In order to leave comments, you need to log in
How to create a lead + contact, but so that the lead is not marked as a repeated one?
If you do the following, then the lead, when it falls in CRM, is designated as repeated :
public function createLeadAndSend()
{
$queryUrl = $this->url_bitrix . '/' . $this->admin_id_bitrix . '/' . $this->webhook_bitrix . '/crm.lead.add.json';
$queryData = http_build_query([
'fields' => [
'TITLE' => $this->title,
'NAME' => $this->fio,
'PHONE' => [
[
'VALUE' => $this->phone,
'VALUE_TYPE' => 'WORK'
]
]
]
]);
$this->curl_result = $this->curl($queryUrl, $queryData);
$result = json_decode($this->curl_result, 1);
$this->leadID = $result["result"];
//Создаем контакт
$this->createContact($this->leadID);
}
/*
* Создаем контакт
*/
public function createContact($id){
$queryUrl = $this->url_bitrix.'/'.$this->admin_id_bitrix.'/'.$this->webhook_bitrix.'/crm.contact.add.json';
$queryData = http_build_query([
'fields' => [
'LEAD_ID' => $id,
'NAME' => $this->fio,
'EMAIL' => [
[
'VALUE' => $this->email,
'VALUE_TYPE' => 'WORK'
]
],
'PHONE' => [
[
'VALUE' => $this->phone,
'VALUE_TYPE' => 'WORK'
]
]
]
]);
$this->curl_result = $this->curl($queryUrl, $queryData);
$result = json_decode($this->curl_result, 1);
$this->contactId = $result["result"];
}
Answer the question
In order to leave comments, you need to log in
In the cloud, no way.
Any lead to an existing client will be repeated.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question