Mastering call-related APIs
Now that we know in more abstract terms how the Twilio API works and have had an introduction to the PHP library and Postman, let's try our hand at playing with the API for real, starting with the Call resource.
All of our examples will include the URL and parameters you can use with Postman, plus a code sample for the PHP library.
Making a call
To make a call, we'll need to make a POST
request to https://api.twilio.com/2010-04-01/Accounts/<your account SID>/Calls.json
with the following parameters:
Parameter |
Explanation |
---|---|
|
This refers to the phone number that will be used as the caller ID for this call (this must be one of your Twilio numbers or another one you own and have verified with Twilio). |
|
This refers to the phone number you need to dial. |
|
This refers to a URL that serves TwiML, which should be used to handle this call. Either this or |
|
This refers to the SID of an application... |