Twilio

Twilio book enables users to interact with and manage their communications via the Twilio API.

Introduction

Twilio provides a comprehensive communication platform, offering features such as SMS, voice calls, video, and chat. Ideal for businesses and developers seeking reliable and scalable communication solutions. The Twilio book ensures secure and seamless access to these services.

This books supports the connectivity methods described in this section. In here you will find information about what information is required in order to employ each method.


Connectivity

This books supports the connectivity methods described in this section.In here you will find information about what information is required in order to employ each method.

Connect using Account SID and Auth Token

Establishes a connection to the Twilio API using the provided account SID and auth token.

LabelDescriptionType
Account SIDThe Account SID from your Twilio account.text
Auth TokenThe Auth Token from your Twilio account.text

Procedures

to read some (SMS messages)



Read some SMS messages using the Twilio API.

Output Concepts

ConceptDescriptionType
SMS messagesA list of SMS messages that matches the specified filtering criteriasms message

Examples

Retrieve SMS messages filtered by sender and recipient numbers

read some sms messages whose sender number is "+18004445555" and whose recipient number is "+18004446666"


Retrieve SMS messages filtered by the date in which they were sent

convert "2022-03-01T15:00:00Z" to a datetime
use the above as the message date
read some sms messages whose date sent is the message date


Retrieve SMS messages that were sent in the specified time period

convert "2022-03-01T15:00:00Z" to a datetime
use the above as the start date
convert "2022-03-03T15:00:00Z" to a datetime
use the above as the end date
read some sms messages whose date sent is after the start date and whose date sent is before the end date

to send an SMS message


Sends an SMS message using the Twilio API.

Input Concepts

ConceptDescriptionTypeRequiredDefault Value
sender numberThe Twilio phone number to send the message fromtextYes
recipient numberThe recipient's phone numbertextYes
message bodyThe body of the SMS message to sendtextYes

Output Concepts

ConceptDescriptionType
answerThe SID of the sent message if successful, otherwise None.text

Examples

Send an SMS message

send an SMS message where
  the sender number is "+18004445555"
  the recipient number is "+18004446666"
  the message body is "Hello from Kognitos!"

Concepts

Sms message

Typically between mobile phones.

Field NameDescriptionType
sidThe unique, Twilio-provided string that identifies the Message resource.text?
bodyThe text content of the messagetext?
num_segmentsThe number of segments that make up the complete message. SMS message bodies that exceed the character limit are segmented and charged as multiple messages. Note: For messages sent via a Messaging Service, num_segments is initially 0, since a sender hasn't yet been assignedtext?
sender_numberThe sender's phone number (in E.164 format), alphanumeric sender IDWireless SIMshort code, or channel address (e.g., whatsapp:+15554449999). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is senttext?
recipient_numberThe recipient's phone number (in E.164 format) or channel address (e.g. whatsapp:+15552229999)text?
priceThe amount billed for the message in the currency specified by price_unit. The price is populated after the message has been sent/received, and may not be immediately availalble. View the Pricing page for more details.number?
account_sidThe SID of the Account associated with the Message resourcetext
num_mediaThe number of media files associated with the Message resource.number
statusThe status of the message, for more information about possible statuses see Message Statustext?
messaging_service_sidThe SID of the Messaging Service associated with the Message resource. A unique default value is assigned if a Messaging Service is not used.text
date_sentThe RFC 2822 timestamp (in GMT) of when the Message was sent. For an outgoing message, this is when Twilio sent the message. For an incoming message, this is when Twilio sent the HTTP request to your incoming message webhook URL.datetime?
date_createdThe RFC 2822 timestamp (in GMT) of when the Message resource was createddatetime?
date_updatedThe RFC 2822 timestamp (in GMT) of when the Message resource was last updateddatetime?
price_unitThe currency in which price is measured, in ISO 4127 format (e.g. usdeurjpy).text
error_codeThe error code returned if the Message status is failed or undelivered. If no error was encountered, the value is null.number?
error_messageThe description of the error_code if the Message status is failed or undelivered. If no error was encountered, the value is null.text?