Answer the question
In order to leave comments, you need to log in
Creating a lead from an infoblock in Bitrix24?
Hello! Please help a newbie in Bitrix.
The goal is to create site integration on the 1C Bitrix platform Site management and Bitrix24 crm. And everything seems to be successful, leads are created, but the specified fields are not added. It turns out that if a lead with the "NAME" field was already created in crm, then everything is fine, the name is transferred from the site, but the rest of the information is not.
$queryData = http_build_query(array(
'fields' => array(
"LOGIN" => $login,
"PASSWORD" => $password,
"TITLE" => 'Лид с сайта',
"NAME" => $name,
"SECOND_NAME" => $phone,
"LAST_NAME" => $special,
"COMMENTS" => "Лид создан автоматически с сайта ",
),
'params' => array("REGISTER_SONET_EVENT" => "Y"),
));
$rest = 'crm.lead.add.json';
$queryUrl = 'тут код вебхука';
$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);
if (array_key_exists('error', $result))
{
echo "Ошибка при сохранении лида: ".$result['error_description']."";
}
else
{
return $result['result'];
}
}
}
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