Note: Twilio is a third-party company whose services are not covered by the Google App Engine Service Level Agreement .
Twilio is powering the future of business communications, enabling developers to embed voice, VoIP, and messaging into applications. They virtualize all infrastructure needed in a cloud-based, global environment, exposing it through the Twilio communications API platform. Applications are simple to build and scalable. Enjoy flexibility with pay-as-you go pricing, and benefit from cloud reliability.
Twilio Voice enables your application to make and receive phone calls. Twilio SMS enables your application to send and receive text messages. Twilio Client allows you to make VoIP calls from any phone, tablet, or browser and supports WebRTC.
Pricing
Google App Engine customers receive complimentary credit for 2,000 SMS messages or inbound minutes when you upgrade. Redeem this Twilio credit and get started here .
Twilio is a pay-as-you-go service. There are no set-up fees and you can close your account at any time. You can find more details at Twilio Pricing .
Platform
The Twilio platform consists of the Twilio Markup Language (TwiML), a RESTful API and VoIP SDKs for web browsers, Android and iOS. Helper libraries are available in multiple languages. You can find the full list at Twilio Helper Libraries .
TwiML
TwiML is a set of instructions you can use to tell Twilio what to do when you receive an incoming call or SMS. When someone makes a call or sends an SMS to one of your Twilio numbers, Twilio will look up the URL associated with that phone number and make a request to that URL. Twilio will read TwiML instructions at that URL to determine what to do:
-
<Say>
- text to speech -
<Record>
- record the call -
<Play>
- play a message for the caller -
<Gather>
- prompt the caller to press digits on their keypad -
<Sms>
- send an SMS
Learn about the other verbs and capabilities from the Twilio Markup Language documentation .
REST API
The Twilio REST API allows you to query metadata about your account, phone numbers, calls, text messages, and recordings. You can also do some fancy things like initiate outbound calls and send text messages.
Since the API is based on REST principles, it's very easy to write and test applications. You can use your browser to access URLs, and you can use pretty much any HTTP client in any programming language to interact with the API. Learn more about the Twilio REST API .
Setting Up
We will be using the standard Google App Engine PHP Runtime Environment to construct this example. If this is your first time writing PHP for Google App Engine, we recommend that you use the Getting Started guide for PHP . Follow the tutorial until you have completed the "Hello, World!" guide.
After you have a working "Hello, World!" application, you will need to add Twilio's PHP library to your application.
Download and decompress this package into the
helloworld
directory you created while following the Getting Started guide:
https://github.com/twilio/twilio-php/archive/master.zip
Include the package as shown within your application:
require '/path-to-your-application/twilio-php/Services/Twilio.php'
You have now installed the Twilio library into your Google App Engine project.