Advertisement
Guest User

Untitled

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