S
S
serik2021-01-25 11:24:49
1C-Bitrix
serik, 2021-01-25 11:24:49

How to add a comment to a lead's timeline?

Hello! Using the REST API via webhooks, I create a lead using the "crm.lead.add.json" method.
After creating a lead, I immediately try to add a comment to the lead's timeline using the "crm.timeline.comment.add.json" method. I pass
the following parameters:

'fields' => array(
            'ENTITY_ID' => intval($newLead),
            'ENTITY_TYPE' => 'lead',
            'COMMENT' => '<br>ФИО: '.$fioStr.'<br>Регион: '.$propFields['REGION']['VALUE'].'<br>Телефон: '.$propFields['PHONE']['VALUE'].'<br>E-mail: '.$propFields['EMAIL']['VALUE'],
        ),


But the comment is not added to the timeline of the lead, tell me what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
serik, 2021-01-25
@black_xe

Like this!

$queryUrl = 'сайт/вебхук/crm.livefeedmessage.add.json';
$queryData = http_build_query(array(
    'fields' => array(
        'POST_TITLE' => 'Заявка на консультацию: ',
        'MESSAGE' => "Битрикс24 создан на базе платформы Bitrix Framework.",
        'ENTITYTYPEID' => 1,
        'ENTITYID' => intval($result['result']),
    )
));


$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_SSL_VERIFYPEER => 0,
    CURLOPT_POST => 1,
    CURLOPT_HEADER => 0,
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => $queryUrl,
    CURLOPT_POSTFIELDS => $queryData,
));
$result = curl_exec($curl);
curl_close($curl);
$result = json_decode($result, 1);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question