Below you will find a list of objects created by interacting with the Twilio API, and the methods and properties that can be called on them.
For more information, see the Account List Resource documentation.
Get an account resource.
Parameters: |
|
---|---|
Returns: | A Services_Twilio_Rest_Account instance |
Create a new subaccount.
Parameters: |
|
---|---|
Returns: | A new Services_Twilio_Rest_Account instance |
The $params array can contain the following keys:
For more information, see the Account Instance Resource documentation.
Update the account
The $params array is the same as in Services_Twilio_Rest_Accounts::create
A 34 character string that uniquely identifies this account.
The date that this account was created, in GMT in RFC 2822 format
The date that this account was last updated, in GMT in RFC 2822 format.
A human readable description of this account, up to 64 characters long. By default the FriendlyName is your email address.
The status of this account. Usually active, but can be suspended if you’ve been bad, or closed if you’ve been horrible.
The authorization token for this account. This token should be kept a secret, so no sharing.
For more information, see the Application Instance Resource documentation.
A 34 character string that uniquely idetifies this resource.
The date that this resource was created, given as GMT RFC 2822 format.
The date that this resource was last updated, given as GMT RFC 2822 format.
A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number.
The unique id of the Account responsible for this phone number.
Calls to this phone number will start a new TwiML session with this API version.
Look up the caller’s caller-ID name from the CNAM database (additional charges apply). Either true or false.
The URL Twilio will request when this phone number receives a call.
The HTTP method Twilio will use when requesting the above Url. Either GET or POST.
The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST.
The URL that Twilio will request to pass status parameters (such as call ended) to your application.
The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST.
The URL Twilio will request when receiving an incoming SMS message to this number.
The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST.
The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.
The HTTP method Twilio will use when requesting the above URL. Either GET or POST.
The URI for this resource, relative to https://api.twilio.com.
For more information, see the Call List Resource documentation.
Make an outgoing call
Parameters: |
|
---|
The $params array can contain the following keys:
For more information, see the Call Instance Resource documentation.
A 34 character string that uniquely identifies this resource.
A 34 character string that uniquely identifies the call that created this leg.
The date that this resource was created, given as GMT in RFC 2822 format.
The date that this resource was last updated, given as GMT in RFC 2822 format.
The unique id of the Account responsible for creating this call.
The phone number that received this call. e.g., +16175551212 (E.164 format)
The phone number that made this call. e.g., +16175551212 (E.164 format)
If the call was inbound, this is the Sid of the IncomingPhoneNumber that received the call. If the call was outbound, it is the Sid of the OutgoingCallerId from which the call was placed.
A string representing the status of the call. May be QUEUED, RINGING, IN-PROGRESS, COMPLETED, FAILED, BUSY or NO_ANSWER.
The start time of the call, given as GMT in RFC 2822 format. Empty if the call has not yet been dialed.
The end time of the call, given as GMT in RFC 2822 format. Empty if the call did not complete successfully.
The length of the call in seconds. This value is empty for busy, failed, unanswered or ongoing calls.
The charge for this call in USD. Populated after the call is completed. May not be immediately available.
A string describing the direction of the call. inbound for inbound calls, outbound-api for calls initiated via the REST API or outbound-dial for calls initiated by a <Dial> verb.
If this call was initiated with answering machine detection, either human or machine. Empty otherwise.
If this call was an incoming call forwarded from another number, the forwarding phone number (depends on carrier supporting forwarding). Empty otherwise.
If this call was an incoming call from a phone number with Caller ID Lookup enabled, the caller’s name. Empty otherwise.
For more information, see the OutgoingCallerId Instance Resource documentation.
A 34 character string that uniquely identifies this resource.
The date that this resource was created, given in RFC 2822 format.
The date that this resource was last updated, given in RFC 2822 format.
A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number.
The unique id of the Account responsible for this Caller Id.
The incoming phone number. Formatted with a ‘+’ and country code e.g., +16175551212 (E.164 format).
The URI for this resource, relative to https://api.twilio.com.
For more information, see the Conference Instance Resource documentation.
A 34 character string that uniquely identifies this conference.
A user provided string that identifies this conference room.
A string representing the status of the conference. May be init, in-progress, or completed.
The date that this conference was created, given as GMT in RFC 2822 format.
The date that this conference was last updated, given as GMT in RFC 2822 format.
The unique id of the Account responsible for creating this conference.
The URI for this resource, relative to https://api.twilio.com.
The Services_Twilio_Rest_Participants instance, listing people currenlty in this conference
For more information, see the Notification Instance Resource documentation.
A 34 character string that uniquely identifies this resource.
The date that this resource was created, given in RFC 2822 format.
The date that this resource was last updated, given in RFC 2822 format.
The unique id of the Account responsible for this notification.
CallSid is the unique id of the call during which the notification was generated. Empty if the notification was generated by the REST API without regard to a specific phone call.
The version of the Twilio in use when this notification was generated.
An integer log level corresponding to the type of notification: 0 is ERROR, 1 is WARNING.
A unique error code for the error condition. You can lookup errors, with possible causes and solutions, in our Error Dictionary.
A URL for more information about the error condition. The URL is a page in our Error Dictionary.
The text of the notification.
The date the notification was actually generated, given in RFC 2822 format. Due to buffering, this may be slightly different than the DateCreated date.
The URL of the resource that generated the notification. If the notification was generated during a phone call: This is the URL of the resource on YOUR SERVER that caused the notification. If the notification was generated by your use of the REST API: This is the URL of the REST resource you were attempting to request on Twilio’s servers.
The HTTP method in use for the request that generated the notification. If the notification was generated during a phone call: The HTTP Method use to request the resource on your server. If the notification was generated by your use of the REST API: This is the HTTP method used in your request to the REST resource on Twilio’s servers.
The Twilio-generated HTTP GET or POST variables sent to your server. Alternatively, if the notification was generated by the REST API, this field will include any HTTP POST or PUT variables you sent to the REST API.
The HTTP headers returned by your server.
The HTTP body returned by your server.
The URI for this resource, relative to https://api.twilio.com
For more information, see the Participant Instance Resource documentation.
A 34 character string that uniquely identifies the call that is connected to this conference
A 34 character string that identifies the conference this participant is in
The date that this resource was created, given in RFC 2822 format.
The date that this resource was last updated, given in RFC 2822 format.
The unique id of the Account that created this conference
true if this participant is currently muted. false otherwise.
Was the startConferenceOnEnter attribute set on this participant (true or false)?
Was the endConferenceOnExit attribute set on this participant (true or false)?
The URI for this resource, relative to https://api.twilio.com.
For more information, see the IncomingPhoneNumbers API Resource documentation at twilio.com.
Return a phone number instance from its E.164 representation. If more than one number matches the search string, returns the first one.
Parameters: |
|
---|---|
Returns: | A Services_Twilio_Rest_IncomingPhoneNumber object, or null |
An object representing a single phone number. For more
information, see the IncomingPhoneNumber Instance Resource documentation.
- property Services_Twilio_Rest_IncomingPhoneNumber::$sid¶
A 34 character string that uniquely idetifies this resource.
- property Services_Twilio_Rest_IncomingPhoneNumber::$date_created¶
The date that this resource was created, given as GMT RFC 2822 format.
- property Services_Twilio_Rest_IncomingPhoneNumber::$date_updated¶
The date that this resource was last updated, given as GMT RFC 2822 format.
- property Services_Twilio_Rest_IncomingPhoneNumber::$friendly_name¶
A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number.
- property Services_Twilio_Rest_IncomingPhoneNumber::$account_sid¶
The unique id of the Account responsible for this phone number.
- property Services_Twilio_Rest_IncomingPhoneNumber::$phone_number¶
The incoming phone number. e.g., +16175551212 (E.164 format)
- property Services_Twilio_Rest_IncomingPhoneNumber::$api_version¶
Calls to this phone number will start a new TwiML session with this API version.
- property Services_Twilio_Rest_IncomingPhoneNumber::$voice_caller_id_lookup¶
Look up the caller’s caller-ID name from the CNAM database (additional charges apply). Either true or false.
- property Services_Twilio_Rest_IncomingPhoneNumber::$voice_url¶
The URL Twilio will request when this phone number receives a call.
- property Services_Twilio_Rest_IncomingPhoneNumber::$voice_method¶
The HTTP method Twilio will use when requesting the above Url. Either GET or POST.
- property Services_Twilio_Rest_IncomingPhoneNumber::$voice_fallback_url¶
The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by Url.
- property Services_Twilio_Rest_IncomingPhoneNumber::$voice_fallback_method¶
The HTTP method Twilio will use when requesting the VoiceFallbackUrl. Either GET or POST.
- property Services_Twilio_Rest_IncomingPhoneNumber::$status_callback¶
The URL that Twilio will request to pass status parameters (such as call ended) to your application.
- property Services_Twilio_Rest_IncomingPhoneNumber::$status_callback_method¶
The HTTP method Twilio will use to make requests to the StatusCallback URL. Either GET or POST.
- property Services_Twilio_Rest_IncomingPhoneNumber::$sms_url¶
The URL Twilio will request when receiving an incoming SMS message to this number.
- property Services_Twilio_Rest_IncomingPhoneNumber::$sms_method¶
The HTTP method Twilio will use when making requests to the SmsUrl. Either GET or POST.
- property Services_Twilio_Rest_IncomingPhoneNumber::$sms_fallback_url¶
The URL that Twilio will request if an error occurs retrieving or executing the TwiML from SmsUrl.
- property Services_Twilio_Rest_IncomingPhoneNumber::$sms_fallback_method¶
The HTTP method Twilio will use when requesting the above URL. Either GET or POST.
- property Services_Twilio_Rest_IncomingPhoneNumber::$uri¶
The URI for this resource, relative to https://api.twilio.com.
For more information, see the AvailablePhoneNumbers API Resource documentation at twilio.com.
Get a list of available phone numbers.
Parameters: |
|
---|---|
Returns: | An instance of the Services_Twilio_Rest_AvailablePhoneNumbers resource. |
A list of Services_Twilio_Rest_AvailablePhoneNumber instances.
The uri representing this resource, relative to https://api.twilio.com.
For more information, see the AvailablePhoneNumber Instance Resource documentation.
A nicely-formatted version of the phone number.
The phone number, in E.164 (i.e. “+1”) format.
The LATA of this phone number.
The rate center of this phone number.
The latitude coordinate of this phone number.
The longitude coordinate of this phone number.
The two-letter state or province abbreviation of this phone number.
The postal (zip) code of this phone number.
For more information, see the Recording Instance Resource documentation.
A 34 character string that uniquely identifies this resource.
The date that this resource was created, given in RFC 2822 format.
The date that this resource was last updated, given in RFC 2822 format.
The unique id of the Account responsible for this recording.
The call during which the recording was made.
The length of the recording, in seconds.
The version of the API in use during the recording.
The URI for this resource, relative to https://api.twilio.com
The list of subresources under this account
A dictionary of the audio formats available for this recording
array(
'wav' => 'https://api.twilio.com/path/to/recording.wav',
'mp3' => 'https://api.twilio.com/path/to/recording.mp3',
)
For more information, see the SMS Message Instance Resource documentation.
A 34 character string that uniquely identifies this resource.
The date that this resource was created, given in RFC 2822 format.
The date that this resource was last updated, given in RFC 2822 format.
The date that the SMS was sent, given in RFC 2822 format.
The unique id of the Account that sent this SMS message.
The phone number that initiated the message in E.164 format. For incoming messages, this will be the remote phone. For outgoing messages, this will be one of your Twilio phone numbers.
The phone number that received the message in E.164 format. For incoming messages, this will be one of your Twilio phone numbers. For outgoing messages, this will be the remote phone.
The text body of the SMS message. Up to 160 characters long.
The status of this SMS message. Either queued, sending, sent, or failed.
The direction of this SMS message. incoming for incoming messages, outbound-api for messages initiated via the REST API, outbound-call for messages initiated during a call or outbound-reply for messages initiated in response to an incoming SMS.
The amount billed for the message.
The version of the Twilio API used to process the SMS message.
The URI for this resource, relative to https://api.twilio.com
For more information, see the Transcription Instance Resource documentation.
A 34 character string that uniquely identifies this resource.
The date that this resource was created, given in RFC 2822 format.
The date that this resource was last updated, given in RFC 2822 format.
The unique id of the Account responsible for this transcription.
A string representing the status of the transcription: in-progress, completed or failed.
The unique id of the Recording this Transcription was made of.
The duration of the transcribed audio, in seconds.
The text content of the transcription.
The charge for this transcript in USD. Populated after the transcript is completed. Note, this value may not be immediately available.
The URI for this resource, relative to https://api.twilio.com
For more information, including a list of filter parameters, see the Queues List Resource documentation.
Create a new Services_Twilio_Rest_Queue.
Parameters: |
|
---|---|
Returns: |
For more information about available properties of a queue, see the Queue Instance Resource documentation. A Queue has one subresource, a list of Services_Twilio_Rest_Members.
For more information, including a list of filter parameters, see the Member List Resource documentation.
Return the Services_Twilio_Rest_Member at the front of the queue.
For more information about available properties, see the Member Instance Resource documentation.
Dequeue this member and immediately play the Twiml at the given $url.
Parameters: |
|
---|---|
Returns: | Services_Twilio_Rest_Member The dequeued member |
For more information, including a list of filter parameters, see the UsageRecords List Resource documentation.
Return the single UsageRecord corresponding to this category of usage. Valid only for the Records, Today, Yesterday, ThisMonth, LastMonth and AllTime resources.
Parameters: |
|
---|---|
Returns: | Services_Twilio_Rest_UsageRecord A single usage record |
For more information, including a list of filter parameters, see the UsageTriggers List Resource documentation.
Create a new UsageTrigger.
Parameters: |
|
---|---|
Returns: | Services_Twilio_Rest_UsageTrigger The created trigger. |