R
R
Roman Govorov2020-04-13 16:37:03
Bitrix24
Roman Govorov, 2020-04-13 16:37:03

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"];
}


How to make sure that a lead is created, the created contact is attached to it and this whole miracle is not marked as a repeated lead?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2020-04-13
@gromdron

In the cloud, no way.
Any lead to an existing client will be repeated.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question