Answer the question
In order to leave comments, you need to log in
Null character in a query, how to find it?
Hello, I have the following code:
$data = [
"date_from" => $date_from,
"date_to" => $date_to,
"from" => [
"extension" => "",
"number" => ""
],
"to" => [
"extension" => "",
"number" => ""
],
"fields" => "records, start, finish, from_extension, from_number, to_extension, to_number, disconnect_reason",
];
$json = json_encode($data);
$sign = hash('sha256', $api_key . $json . $api_salt);
$post = [
"vpbx_api_key" => $api_key,
"sign" => $sign,
"json" => $json
];
$post = http_build_query($post);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = json_decode(curl_exec($ch));
curl_close($ch);
Answer the question
In order to leave comments, you need to log in
$post = http_build_query($post); similar conversions have been around for 5 years as "legacy" may need to transfer headers for proper transmission.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question