Twilio Imessage



-->

  • Inbound messages When Twilio receives message requests from your application, these requests are queued for delivery in the order we receive them. Each of your Twilio phone numbers has a separate queue, and each queue can hold up to 4 hours' worth of message segments based on the sending rate for a phone number type.
  • The Twilio bindings are provided in the Microsoft.Azure.WebJobs.Extensions.Twilio NuGet package, version 1.x. Source code for the package is in the azure-webjobs-sdk GitHub repository. The following table tells how to add support for this binding in each development environment.
  • Send iMessage, if fail then send text via twilio. But otherwise couldn't see the use case (at least for reliable delivery rate) probe 11 months ago. You're spot on - iMessage returns a datedelivered so we know if it's successful or not, and send an SMS backup via Twilio.

Twilio enables apps to send and receive global SMS, MMS and IP messages.

Control what you share. And when you chat. Only you can start a conversation. And when you do, the company can’t see personal information, like your name or phone number, unless you choose to share it for appointments or deliveries.

This connector is available in the following products and regions:

Twilio Message Rates

ServiceClassRegions
Logic AppsStandardAll Logic Apps regions except the following:
- Azure China regions
Power AutomateStandardAll Power Automate regions except the following:
- US Government (GCC High)
- China Cloud operated by 21Vianet
Power AppsStandardAll Power Apps regions except the following:
- US Government (GCC High)
- China Cloud operated by 21Vianet
Contact
NameMicrosoft
URLMicrosoft LogicApps Support
Microsoft Power Automate Support
Microsoft Power Apps Support
Connector Metadata
PublisherMicrosoft
Websitehttps://www.twilio.com/
Privacy policyhttps://www.twilio.com/legal/privacy

Connector in-depth

For more information about the connector, see the in-dept section.

Creating a connection

The connector supports the following authentication types:

DefaultRequired parameters for creating connection.All regionsNot shareable

Default

Applicable: All regions

Required parameters for creating connection.

This is not shareable connection. If the power app is shared with another user, another user will be prompted to create new connection explicitly.

NameTypeDescription
Twilio Account IdsecurestringTwilio Account Id
Twilio Access TokensecurestringTwilio Access Token

Throttling Limits

NameCallsRenewal Period
API calls per connection120060 seconds

Actions

Get Message

This operation returns a single message specified by the provided Message ID.

List Messages

Returns a list of messages associated with your account.

Send Text Message (SMS)

This operation is used to send a new message to a mobile number. Download qq international.

Get Message

This operation returns a single message specified by the provided Message ID.

Parameters

NameKeyRequiredTypeDescription
MessageId True string

Unique SID of the message.

Twilio message length

Returns

Proprties of a single message.

Message
Message

List Messages

Returns a list of messages associated with your account.

Parameters

NameKeyRequiredTypeDescription
To string

Only show messages to this phone number.

From Phone Number
From string

Only show messages from this phone number.

DateSent date

Only show messages sent on this date (in GMT format), given as YYYY-MM-DD. Example: 2009-07-06.

Limit
PageSize integer

How many resources to return in each list page. Default is 50.

Page integer

Page number. Default is 0.

Returns

List of one or more messages.

Message List
MessageList

Send Text Message (SMS)

This operation is used to send a new message to a mobile number.

Parameters

NameKeyRequiredTypeDescription
from True string

A Twilio phone number (in E.164 format) or alphanumeric sender ID enabled for the type of message you wish to send.

To Phone Number
to True string

The destination phone number. Format with a '+' and country code e.g., +16175551212 (E.164 format).

body True string

The text of the message you want to send, limited to 1600 characters.

Media Url
Media Urls uri
StatusCallback uri

A URL that Twilio will POST to each time your message status changes.

Messaging Service Sid
messaging_service_sid string

Unique id of the Messaging Service.

application_sid string

SID of Twilio Application which is configured with the required Message status call back.

Max Price
max_price string

The total maximum price limit for the message.

validity_period string

The number of seconds that the message can remain in a Twilio queue.

Returns

Proprties of a single message.

Message
Message

Definitions

Message

Proprties of a single message.

NamePathTypeDescription
body string

Body of the message.

From Number
from phone

Phone number from which the message was sent.

to phone

Phone number to which the message was sent.

Status
status string

Sent status of the message.

sid string

SID of the sent message.

Account Sid
account_sid string

SID of the account associated with the sent message.

api_version string

Version of the API used to send the message.

Segment Count
num_segments string

Number of segments the message was divided into.

num_media string

Number of media files associated with the sent message.

Created Date-Time
date_created string

yyyy-MM-ddTHH:mm:ss.fffZ (UTC format)

date_sent string

yyyy-MM-ddTHH:mm:ss.fffZ (UTC format)

Updated Date-Time
date_updated string

yyyy-MM-ddTHH:mm:ss.fffZ (UTC format)

direction string

Direction associated with the sent message.

Error Codes
error_code integer

Error codes associated with the sent message, if any.

error_message string

Error messages associated with the sent message, if any.

Price
price string

Cost of the sent message.

price_unit string

Price unit used to evaluate the cost of the message.

URI
uri uri

Relative URI for this resource.

subresource_uris object

Relative URIs for any subresources.

Messaging Service Sid
messaging_service_sid string

Unique id of the messaging Service.

MessageList

Twilio Messagesid

List of one or more messages.

NamePathTypeDescription
messages array of Message
Page
page integer

Page number of the respone.

page_size integer

Page size of the response.

Page Count
num_pages integer

Total number of pages in the response.

start integer

Index of the first message.

End
end integer

Index of the last message.

uri uri

Relative URI for this list.

First Page URI
first_page_uri uri

Relative URI for the first page.

next_page_uri uri

Relative URI for the next page.

Message Count
total integer

Total number of messages.

previous_page_uri uri

Relative URI for the previous page.

Short Message Service (SMS) text messages are ubiquitous for communicationall over the world. It is easy to send SMS text messages from aPython application using aweb application programming interface (API).Let's take a look at the tools we need to quickly add SMS capability to ourPython apps.

Tools We Need

This guide works with both Python 2 and 3, so make sure you have one ofthose two versions installed.

  • Either Python 2 or 3
  • pip andvirtualenv to handleapplication dependencies
  • A free Twilio account to use theirSMS web API
  • Open sourceTwilio Python helper library,version 6.0.0or later

If you need assistance getting pip and virtualenv installed, check out thefirst few steps of thehow to set up Python 3, Flask and Green Unicorn on Ubuntu 16.04 LTSguide that'll show how to install system packages for those tools.

Using a Web API

We're going to use a web API to make sending SMS easier and more reliable.Head to theTwilio website and sign up for a free trial accountawesome for more than just sending text messages!) then sign into yourexisting account.

The Twilio trial account allows you to send text messages to your ownvalidated phone number. When you want to send SMS to any phone number inyour country or other countries then you can upgrade your account to sendmessages for fractions of a cent.

After signing up, you will get a free phone number in your country. We canuse that phone number without any configuration to send outbound textmesssages. You can also receive text messages but that requires changingthe Request URL webhook in the phone number configuration screen - we'llcover that in a future blog post.

Installing Our Dependency

Our code will use a helper library to make it easier to send text messagesfrom Python. We are going to install the helper library fromPyPI into a virtualenv. First we need tocreate the virtualenv. In your terminal use the following command to createa new virtualenv. If you need to install virtualenv take a look at thehow to set up Python 3, Flask and Green Unicorn on Ubuntu 16.04 LTSguide.

Activate the virtualenv.

The command prompt will change after we properly activate the virtualenvto something like this:

Now install the Twilio Python helper library. We are using the 6.0.0or above library version, which is important because the syntax inthis post is backwards-incompatible with 5.x and previous Twilio helperlibrary versions.

The helper library is now installed and we can use it with the Python codewe create and execute.

Sending SMS From Python

Fire up the Python interpreter in the terminal using the python command,or create a new file named send_sms.py.

We need to grab our account credentials from the Twilio Console to connectour Python code to our Twilio account. Go to theTwilio Console and copy the Account SIDand Authentication Token into your Python code.

Enter the following code into the interpreter or into the new Python file.You can also copy and paste the code from theblog-code-examples Git repositoryin theFull Stack Python GitHub organization.

All the lines above that start with # are comments. Once you enter thatcode into the interpreter or run the Python script usingpython send_sms.py the SMS will be sent.

In a few seconds you should see a message appear on your phone. I'm oniOS so here's how the text message I received looked.

That's it! You can add this code to any Python code to send text messages.Just keep your Auth Token secret as it'll allow anyone that has it to useyour account to send and receive messages.

Questions? Contact me via Twitter@fullstackpythonor @mattmakai. I'm also on GitHub withthe username mattmakai.

Twilio Imessage Login

See something wrong in this post? Forkthis page's source on GitHuband submit a pull request.