Advertisement
Guest User

Untitled

a guest
Oct 6th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <?php
  2.  
  3. $username = 'hidden_but_acqurate';
  4. $password = 'hidden_but_acqurate';
  5.  
  6. $header = base64_encode($username . ":" . $password);
  7.  
  8. $post = [
  9. 'name' => 'IPPCscenario',
  10. 'description' => 'This simple scenario for IPPC 2017 CALL CENTER IVR.',
  11. 'script' => [
  12. 'say' => 'Dear Customer, we will show you how to use create, read, update, delete scenarios methods.'
  13. ],
  14. 'hangup' => true
  15.  
  16. ];
  17.  
  18. $headers = [
  19.  
  20. 'POST: /voice/ivr/1/scenarios HTTP/1.1',
  21.  
  22. 'Host: api.infobip.com',
  23.  
  24. 'Authorization: Basic ' .$header,
  25.  
  26. 'Content-Type: application/json',
  27.  
  28. 'Accept: application/json',
  29.  
  30. ];
  31.  
  32.  
  33.  
  34.  
  35. $ch = curl_init();
  36. curl_setopt($ch, CURLOPT_URL, "https://api.infobip.com/voice/ivr/1/scenarios");
  37. curl_setopt($ch, CURLOPT_POST, 1);
  38. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  39.  
  40.  
  41.  
  42.  
  43. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  44.  
  45.  
  46.  
  47.  
  48. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  49.  
  50.  
  51. $request = curl_exec ($ch);
  52.  
  53. curl_close ($ch);
  54.  
  55. print $request ;
  56.  
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement