PLATFORMS SOLUTIONS BLOGS CONTACT

Twilio Adapter



This adapter allows you to implement the Twilio service from SQL Server databases and through REST calls.




Configuration Settings



Name Description Default
Boolean _isDefault Make this the default configuration. Defaults to true if configName is already the default.
String accountSid
String authenticationToken
String callerId
String defaultCountryCode +1
String statusUrl
String twimlUrl
String mediaUrl

Handlers



ListCall List details of a single call. details 

Arguments

Name Description Default
sid R A specific call identifier to retrieve

SQL Call

exec bsc.Twilio.ListCall 'CA123456789'
select * from Twilio.Call where callSid = 'CA123456789'


Http Call

/bsc/twilio/listcall

Output Columns

String SidTwilio call unique identifier
String ParentCallSidTwilio call that created this leg
DateTime DateCreatedThe date/time in UTC that this resource was created
DateTime DateUpdatedThe date/time in UTC that this resource was last updated
String AccountSidThe unique id of the Account responsible for creating this call
String ToThe phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String FromThe phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String PhoneNumberSidIf 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.
String StatusA string representing the status of the call. May be queued, ringing, in-progress, canceled, completed, failed, busy or no-answer.
DateTime StartTimeThe start time in UTC of the call. Empty if the call has not yet been dialed.
DateTime EndTimeThe end time in UTC of the call. Empty if the call did not complete successfully.
Int32 DurationThe length of the call in seconds. This value is empty for busy, failed, unanswered or ongoing calls.
Decimal PriceThe charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
String DirectionA 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 verb.
String AnsweredByIf this call was initiated with answering machine detection, either human or machine. Empty otherwise.
String ForwardedFromIf this call was an incoming call forwarded from another number, the forwarding phone number (depends on carrier supporting forwarding). Empty otherwise.
String CallerNameIf this call was an incoming call to a phone number with Caller ID Lookup enabled, the caller's name. Empty otherwise.
String UriThe URI for this resource, relative to https://api.twilio.com
ListCalls Phone calls made to and from an account. details 

Arguments

Name Description Default
startTime Only show calls that started from this date/time. Default is UTC midnight today.
endTime Only show calls that ended by this date/time
fromPhone Only show calls from this phone number
toPhone Only show calls to this phone number
status Only show calls currently in this status
parentCallSid Only show calls that belong to this parent call (e.g. Dial legs)
maxRows Maximum number of rows to return. Use TOP N if using SELECT.

SQL Call

exec bsc.Twilio.ListCalls
select top 100 * from Twilio.Calls


Http Call

/bsc/twilio/listcalls

Output Columns

String SidTwilio call unique identifier
String ParentCallSidTwilio call that created this leg
DateTime DateCreatedThe date/time in UTC that this resource was created
DateTime DateUpdatedThe date/time in UTC that this resource was last updated
String AccountSidThe unique id of the Account responsible for creating this call
String ToPhoneThe phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String FromPhoneThe phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String PhoneNumberSidIf 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.
String StatusA string representing the status of the call. May be queued, ringing, in-progress, canceled, completed, failed, busy or no-answer.
DateTime StartTimeThe start time in UTC of the call. Empty if the call has not yet been dialed.
DateTime EndTimeThe end time in UTC of the call. Empty if the call did not complete successfully.
Int32 DurationThe length of the call in seconds. This value is empty for busy, failed, unanswered or ongoing calls.
Decimal PriceThe charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
String DirectionA 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 verb.
String AnsweredByIf this call was initiated with answering machine detection, either human or machine. Empty otherwise.
String ForwardedFromIf this call was an incoming call forwarded from another number, the forwarding phone number (depends on carrier supporting forwarding). Empty otherwise.
String CallerNameIf this call was an incoming call to a phone number with Caller ID Lookup enabled, the caller's name. Empty otherwise.
String UriThe URI for this resource, relative to https://api.twilio.com
ListMessage List details of a single message. details 

Arguments

Name Description Default
sid R A specific message identifier to retrieve

SQL Call

exec bsc.Twilio.ListMessage 'CA123456789'
select * from Twilio.Message where callSid = 'CA123456789'


Http Call

/bsc/twilio/listmessage

Output Columns

String SidTwilio message unique identifier
DateTime DateCreatedThe date/time in UTC that this resource was created
DateTime DateUpdatedThe date/time in UTC that this resource was last updated
String AccountSidThe unique id of the Account responsible for creating this call
String ToThe phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String FromThe phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String StatusA string representing the status of the call. May be queued, ringing, in-progress, canceled, completed, failed, busy or no-answer.
String NumSegmentsThe number of body segments associated with this message. For example, an message of 180 characters will be split into one message of 160 characters and another of 20, where NumSegments will be 2.
DateTime DateSentThe date in UTC of the call. Empty if the call has not yet been dialed.
Decimal PriceThe charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
String DirectionA 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 verb.
String UriThe URI for this resource, relative to https://api.twilio.com
String ErrorCodeResulting error code
String ErrorMessageResulting error message
ListMessages Messages sent to and from an account. details 

Arguments

Name Description Default
dateSent Only show messages sent beginning on this date/time. Default is UTC midnight today.
fromPhone Only show calls from this phone number
toPhone Only show calls to this phone number
maxRows Maximum nuber of rows to return. Use TOP N if using SELECT.

SQL Call

exec bsc.Twilio.ListMessages
select top 100 * from Twilio.Messages


Http Call

/bsc/twilio/listmessages

Output Columns

String SidTwilio message unique identifier
DateTime DateCreatedThe date/time in UTC that this resource was created
DateTime DateUpdatedThe date/time in UTC that this resource was last updated
String AccountSidThe unique id of the Account responsible for creating this call
String ToThe phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String FromThe phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String StatusA string representing the status of the call. May be queued, ringing, in-progress, canceled, completed, failed, busy or no-answer.
String NumSegmentsThe number of body segments associated with this message. For example, an message of 180 characters will be split into one message of 160 characters and another of 20, where NumSegments will be 2.
DateTime DateSentThe date in UTC of the call. Empty if the call has not yet been dialed.
Decimal PriceThe charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
String DirectionA 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 verb.
String UriThe URI for this resource, relative to https://api.twilio.com
String ErrorCodeResulting error code
String ErrorMessageResulting error message
ListUsage Retrieve usage made by your Twilio account during any time period and by any usage category. details 

Arguments

Name Description Default
category Category of usage
startDate Only include usage that has occurred on or after this date
endDate Only include usage that has occurred on or before this date.

SQL Call

exec bsc.Twilio.ListUsage 'test'
select * from Twilio.ListUsage


Http Call

/bsc/twilio/listusage

Output Columns

String CategoryThe category of usage. See Usage Categories below.
String DescriptionA human-readable description of the usage category.
String AccountSidThe Account that accrued the usage.
DateTime StartDateThe first date for which usage is included in this UsageRecord, formatted as YYYY-MM-DD. All dates are in GMT.
DateTime EndDateThe last date for which usage is included in this UsageRecord, formatted as YYYY-MM-DD. All dates are in GMT.
Int32 UsageThe amount of usage (e.g. the number of call minutes). This is frequently the same as Count, but may be different for certain usage categories like calls, where Count represents the number of calls and Usage represents the number of minutes.
String UsageUnit The units in which Usage is measured. For example minutes for calls, messages for SMS.
Int32 CountThe number of usage events (e.g. the number of calls).
String CountUnit The units in which Count is measured. For example calls for calls, messages for SMS.
Decimal PriceThe total price of the usage, in the currency associated with the account.
String PriceUnitThe currency in which Price is measured, in ISO 4127 format (e.g. usd, eur, jpy).
String UriThe URI that returns only this UsageRecord, relative to https://api.twilio.com.
SendMms Send an MMS message with an attached image. details 

Arguments

Name Description Default
phones R One or more phone numbers to call separated by semi-colons (";").
message R The text of the message you want to send, limited to 160 characters.
mimeType R image/gif, image/png, image/jpeg, etc. mime-types
mimeFilespec R File to send. If initiating via REST, do not add argument as a header, but instead attach as a file to the POST request specifying a Content-Type of 'multipart/form-data'.

SQL Call

exec Twilio.SendNms '5611234567', 'Hello, world.'
insert Twilio.Mms (phonesToCall, message ) values ( '5611234567', 'Hello, world.')


Http Call

/bsc/twilio/sendmms

Output Columns

String SidTwilio message unique identifier
DateTime DateCreatedThe date/time in UTC that this resource was created
DateTime DateUpdatedThe date/time in UTC that this resource was last updated
String AccountSidThe unique id of the Account responsible for creating this call
String ToThe phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String FromThe phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String StatusA string representing the status of the call. May be queued, ringing, in-progress, canceled, completed, failed, busy or no-answer.
String NumSegmentsThe number of body segments associated with this message. For example, an message of 180 characters will be split into one message of 160 characters and another of 20, where NumSegments will be 2.
DateTime DateSentThe date in UTC of the call. Empty if the call has not yet been dialed.
Decimal PriceThe charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
String DirectionA 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 verb.
String UriThe URI for this resource, relative to https://api.twilio.com
String ErrorCodeResulting error code
String ErrorMessageResulting error message
SendSms Send an SMS message. details 

Arguments

Name Description Default
phones R One or more phone numbers to call separated by semi-colons (";").
message R The text of the message you want to send, limited to 1600 characters.

SQL Call

exec Twilio.SendSms '5611234567', 'Hello, world.'
insert Twilio.Sms (phonesToCall, message ) values ( '5611234567', 'Hello, world.')


Http Call

/bsc/twilio/sendsms

Output Columns

String SidTwilio message unique identifier
DateTime DateCreatedThe date/time in UTC that this resource was created
DateTime DateUpdatedThe date/time in UTC that this resource was last updated
String AccountSidThe unique id of the Account responsible for creating this call
String ToThe phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String FromThe phone number, SIP address or Client identifier that made this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String StatusA string representing the status of the call. May be queued, ringing, in-progress, canceled, completed, failed, busy or no-answer.
String NumSegmentsThe number of body segments associated with this message. For example, an message of 180 characters will be split into one message of 160 characters and another of 20, where NumSegments will be 2.
DateTime DateSentThe date in UTC of the call. Empty if the call has not yet been dialed.
Decimal PriceThe charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available.
String DirectionA 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 verb.
String UriThe URI for this resource, relative to https://api.twilio.com
String ErrorCodeResulting error code
String ErrorMessageResulting error message
SendVoiceMsg Send a voice message. details 

Arguments

Name Description Default
phones R One or more phone numbers to call separated by semi-colons (";"). In addition to the phone number, three additional parameters may be specified with a number: hangupIfMachine, sendDigits, and timeout. For example, "2120000000,1,ww123,15;4150000000,,,30" would call 2120000000 and hang up phone if an answering machine is detected, send two pauses followed by the numbers 1, 2, and 3, and hangup if no one answers after 15 seconds. 4150000000 would wait 30 seconds before haning up if no one answers. Details: hangupIfMachine will hangup the call if an answering machine is detected. sendDigits is a string of keys to dial after connecting to the number. Valid digits in the string include: any digit (0-9), '#', '*' and 'w' (to insert a half second pause). For example, if you connected to a company phone number, and wanted to pause for one second, dial extension 1234 and then the pound key, use SendDigits=ww1234#. imeout is an integer number of seconds that Twilio should allow the phone to ring before assuming there is no answer. Default is 60 seconds, the maximum is 999 seconds. Note, you could set this to a low value, such as 15, to hangup before reaching an answering machine or voicemail.
twiml R Twilio TwiML script
record Set this parameter to 'true' to record the entirety of a phone call. False
from The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified outgoing caller id for your account.

SQL Call

exec Twilio.SendVoiceMsg '5611234567', 'Hello, world.'
insert Twilio.SendVoiceMsg (phonesToCall, twiml ) values ( '5611234567', 'Hello, world.')


Http Call

/bsc/twilio/sendvoicemsg

Output Columns

String FromThe phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified outgoing caller id for your account.
String ToThe phone number, SIP address or Client identifier that received this call. Phone numbers are in E.164 format (e.g. +16175551212). SIP addresses are formated as name@company.com. Client identifiers are formatted client:name.
String StatusA string representing the status of the call. May be queued, ringing, in-progress, canceled, completed, failed, busy or no-answer.
DateTime StartTimeTime call was initiated
DateTime EndTimeTime call completed
String DurationLength of call in seconds
String AnsweredByWhether answered by human or machine.
String AccountSidThe unique id of the Account responsible for creating this call
String SidTwilio call unique identifier







601 21st St Suite 300
Vero Beach, FL 32960
United States

(561) 921-8669
info@enzounified.com
terms of service
privacy policy

PLATFORM

ENZO SERVER
ENZO DATAZEN

SOLUTIONS

SOLUTIONS OVERVIEW
INTEGRATION
SaaS
CLOUD ANALYTICS

RESOURCES

DOWNLOAD
BLOGS & VIDEOS
IN THE NEWS
ENZO ADAPTERS
ONLINE DOCUMENTATION
TCO CALCULATOR

COMPANY

LEADERSHIP TEAM
PARTNERS


© 2023 - Enzo Unified