Skip to content

Instantly share code, notes, and snippets.

@allomov
Last active February 17, 2020 14:11
Show Gist options
  • Save allomov/5337e1511e50386d683be7545515f1ba to your computer and use it in GitHub Desktop.
Save allomov/5337e1511e50386d683be7545515f1ba to your computer and use it in GitHub Desktop.
Создание звонка через Custom HTTPS интеграцию с помощью PHP. YOUR_AUTHORIZATION_TOKEN и YOUR_INTEGRATION_URL берется из DealApp приложения https://www.notion.so/dealapp/Custom-HTTPS-v1-5288b1eebcc84188a383bd59755a0f40
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "YOUR_INTEGRATION_URL",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS =>"{\n \"operator_id\": \"00034\",\n \"client_id\": \"+375294454633\",\n \"direction\": \"incoming\",\n \"duration\": 410.1,\n \"phone_number_source\": \"+375294454633\",\n \"phone_number_target\": \"+375335454633\",\n \"audio_source_url\": \"https://file-examples.com/wp-content/uploads/2017/11/file_example_WAV_1MG.wav\"\n}\n",
CURLOPT_HTTPHEADER => array(
"Authorization: YOUR_AUTHORIZATION_TOKEN",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment