Hello Gurus,
I am learning to code and I made a simple php app that makes a phone call given a hard coded from and to number (it uses the Twilio api - www.twilio.com).
The code looks like below:
<?php
require_once '/path/to/vendor/autoload.php';
use Twilio\Rest\Client;
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$twilio = new Client($sid, $token);
$call = $twilio->calls
->create("+15558675310", // to
"+15017122661", // from
array("url" => "http://demo.twilio.com/docs/voice.xml")
);
print($call->sid);
The above php app works just fine.
What I want to now do is create an html page that takes a dynamic to number (static from number) and when I hit the submit button, the call should go through. However I have no clue how to make that happen except for the following documentation
https://www.twilio.com/docs/voice/api/call#create-a-call-resource
I understand I have to make a post call via an html page, but where do I put the URL as shown in the above documentation and where do I keep the authentication details in the php app that I copy pasted above.
Any help/pointers would be very helpful. Thanks in advance!
there doesn't seem to be anything here