Answer the question
In order to leave comments, you need to log in
Why is the application not cancelled?
<?php
require_once('rest_api.php');
$api_auth = [
"name" => "", //названием магазина
"user_num" => "1", // "1"
"auth_secret_key" => "" //хук
];
$queryData = http_build_query(array(
"filter" => [ "PHONE"=> $_POST['phone'] ],
'select' => [ "ID", "TITLE", "status_id", "STATUS_SEMANTIC_ID" ]
));
$result = rest_api("list", $queryData, $api_auth);
if (array_key_exists('error', $result)) echo "Ошибка при получении лида: ".$result['error_description']."<br/>";
print_r($result);
echo "<br>||||||||||<br>";
print_r($result['result'][0]['ID']);
if ($result['result'][0]['ID']) {
echo "<br>===========<br>";
$queryData = http_build_query(array(
"id" => $result['result'][0]['ID'],
"fields" => [
"status_id" => "JUNK"
],
'params' => ["REGISTER_SONET_EVENT" => "Y"]
));
$result = rest_api("update", $queryData, $api_auth);
if (array_key_exists('error', $result)) echo "Ошибка при обновлении статуса: ".$result['error_description']."<br/>";
echo "Статус успешно изменён";
echo "<br><br>=======================<br>";
print_r($result);
echo "<br>========================<br><br>";
$queryData = http_build_query(array(
"filter" => [ "PHONE"=> $_POST['phone'] ],
'select' => [ "ID", "TITLE", "status_id" ]
));
$result = rest_api("list", $queryData, $api_auth);
if (array_key_exists('error', $result)) echo "Ошибка при получении лида: ".$result['error_description']."<br/>";
echo "<br>--------";
print_r($result);
}
?>
<form action="remove.php" method="POST">
<p>Телефон: <input type="phone" name="phone"></p>
<p><input type="submit" value="Отменить заявку"></p>
</form>
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