- API & Docs
This tutorial assumes you have a Ruby development environment
Sinatra and the
library. If you don't have these yet, please see our post on setting up your environment.
To initiate a new outgoing phone call, we need to specify three things:
Lets take a look at these parameters in a little more detail.
The 'From' parameter must be set to one of your Twilio Numbers or to a phone number that you have verified with Twilio.
If you don't have a Twilio Number yet, or you want to use a different number for the caller ID, you can verify a number on the Phone Numbers page of your account.
The 'To' parameter is the phone number you wish to call. It should be formatted
with a '+' and country code e.g.,
+16175551212. '1' is the international
country code for the US and Canada, and the '+' formats the number in
E.164, the phone number standard used by Twilio.
The final parameter is the HTTP URL of the TwiML file that Twilio will fetch when the call is answered.