Software developers can start the Twilio journey simply by register for a Twilio account at Twilio.com and clicking the signup link, very straightforward.
First thing when there is to take a look the ‘Account Summary’ and take note of the AccountSid and Auth Token listed in this section — these are the Twilio API credentials and they are required to access the API. Both function essentially as “API passwords”. In case Auth Token becomes compromised it is also possible to reset or rotate .
These API credentials are specific to a primary Twilio account.
Developers can also create Twilio sub-accounts , which can be helpful in multi-tenant applications by isolating each customer’s activity. Sub-accounts have their own credentials and grant flexibility to control access for each user of the application, and can help facilitate reporting as well as usage notifications — on a per account basis.
The left-side dock of the Portal provides navigation across all Twilio products. (to access a main menu with all the products, developers can click the all Products icon — a little circle with three dots):
Choosing a product from the main menu enables access to the configuration and tools specific to that product. Two examples:
- When Programmable Voice is chosen, the console opens a "recent calls" dashboard and offers access to call logs and voice tools.
- Programmable Messaging has its own dashboard/admin tools, including logs and message services.
Here are some cool Voice, SMS & MMS features:
The Call Logs menu enables review of all Twilio calls, recordings and transcriptions. Such logs are helpful in reviewing account activity and troubleshooting the app.
- Any calls or messages with errors are shaded in color red.
- Call logs contain a request inspector which allows viewing/debugging Twilio’s connection to the developer's server.
- Each call has an associated status, indicating the result of the call
- Logs can be filtered & exported to CSV format for instance.
- A messaging logs page is also available
The API Explorer allows viewing the Twilio API and interactively making API requests from the Internet browser — awesome way to try out Twilio API functions and gain familiarity with the API.
DEBUGGER and MONITOR
No matter what Twilio product is being used, the Debugger will watch for new errors. If it notices that an error has taken place, it glows red. The Debugger also shows a chart of all the errors that have taken place in the last 24 hours.
In addition to grouping debugging events by type, developers can now group errors by the webhook URI associated with it, providing some insight to the problematic endpoints of the app.
And here's what can be accomplished through the Account Management menu.
- The Manage Users section under User Settings allows to invite additional people and set their access the account.
- Through Account Settings screen , 2FA can be set for the Twilio account.
- The Billing menu allows for management of credit cards and auto-recharging of the account.
How Twilio Communicates with the App
The app sends instructions to Twilio, which notifies the application of any relevant events, correlating two kinds of communications Twilio will establish with the app :
The Twilio REST API is a secure HTTP request sent from the application to Twilio. When the application would like to send an instruction to Twilio (ex: to dial a phone call; or purchase a phone number), the app will make use of the Twilio REST API.
- A TwiML request (the Twilio Markup Language) is an HTTP request sent from Twilio to the application. Your application creates a TwiML (XML) response which tells Twilio what actions to take with an incoming call or SMS. For example, TwiML can determine whether a call is forwarded to an operator or sent to a voicemail message.
Both the REST API and TwiML are HTTP requests; here a some ways to understand differences & when to use each:
- When the app wants to send an instruction to Twilio, it initiates a REST API request to Twilio.
- When Twilio wants to inform the application an event has ocurred, Twilio sends a TwiML request to the application.
- REST API calls initiate an action and state change (initiate a call, initiate an SMS, initiate a log download)
- TwiML requests are reactive to a state change (an incoming call is received, an outgoing call is answered, incoming SMS is received).
So here's a chart depicting an example voice REST API Request, followed by the TwiML Request and Response: