How does Twilio Client work?
There are four steps to follow when working with Twilio Client:
Setting it up with your credentials
Placing outgoing calls
Dealing with incoming calls
Interacting with calls currently in progress
Setting up the client
To get started, you'll use your language's Twilio API library to generate a Capability Token. This gives the client the right to make and/or receive calls using your account.
The following are embedded in this token:
Your account credentials, ensuring that only you can give clients the right to make and receive calls using your Twilio credit
The identifier that will be used to receive calls (if the client is allowed to receive calls)
The Twilio application SID that will be used to place outgoing calls (if the client is allowed to place outgoing calls)
As an example, using the PHP library, we'll generate a Client token like this:
$accountSid = '<your account SID>'; $authToken = '<your auth token>'; $capability = new Services_Twilio_Capability($accountSid...