Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = 'hidden_but_acqurate';
- $password = 'hidden_but_acqurate';
- $header = base64_encode($username . ":" . $password);
- $post = [
- 'name' => 'IPPCscenario',
- 'description' => 'This simple scenario for IPPC 2017 CALL CENTER IVR.',
- 'script' => [
- 'say' => 'Dear Customer, we will show you how to use create, read, update, delete scenarios methods.'
- ],
- 'hangup' => true
- ];
- $headers = [
- 'POST: /voice/ivr/1/scenarios HTTP/1.1',
- 'Host: api.infobip.com',
- 'Authorization: Basic ' .$header,
- 'Content-Type: application/json',
- 'Accept: application/json',
- ];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://api.infobip.com/voice/ivr/1/scenarios");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- $request = curl_exec ($ch);
- curl_close ($ch);
- print $request ;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement