Twilio SMS enables you to send and receive text messages over the carrier network to any phone, anywhere in the world. With phone numbers available in over 30 countries and competitive rates, Twilio’s inventory lets you pick the right numbers with the right capabilities for your project. Twilio handles ever-changing telecom logic and carrier specific rules to ensure your message reaches its destination.
Twilio supports a wide variety of capabilities as seen in the channel capabilities grid. Below is a detailed view of each capabilities.
Delivery events allow you to track deliveries of Sunshine Conversations messages to Twilio by subscribing to the conversation:message:delivery:channel
webhook. Sunshine Conversations also tracks user deliveries on Twilio which let you confirm whether a message has reached the user by listening to the conversation:message:delivery:user
webhook. Failures to deliver a message to Twilio or to a Twilio user can be detected by subscribing to the conversation:message:delivery:failure
webhook.
The Twilio message IDs associated with each Sunshine Conversations message are available in delivery event payloads in the externalMessages
property.
You’ll need a Twilio account with a phone number configured on it. Once you’ve set up your Twilio account, obtain your API credentials from the Twilio account settings page. Then, select the phone number from the Twilio phone numbers page and enter the SID
and API credentials in the dashboard or via the REST API.
You should now be able to receive messages from your Twilio phone number and reply via any of your configured business system integrations.
Twilio Messaging Service offers a bundled set of messaging functionality around senders, features, and configuration. It is possible to integrate a Messaging Service SID with Sunshine Conversations to receive messages from customers and reply from any of your business system integrations.
Creating an integration using a Messaging Service is only available through the Sunshine Conversations Integration API. An integration can be created with either a phoneNumberSid
or messagingServiceSid
; only one of these properties should be specified when creating a Twilio integration.
To initiate a conversation with a user for which you know their phone number, you can use the Notification API. For more information on outbound messaging, consult the guide.
Initiate a conversation with a user over SMS by making a request to the Notifications endpoint:
curl https://api.smooch.io/v1.1/apps/5963c0d619a30a2e00de36b8/notifications \
-X POST \
-d '{
"destination": {
"integrationId": "5e1f438bf99fb467810c0ab9",
"destinationId": "+15145555333"
},
"author": {
"role": "appMaker"
},
"message": {
"type": "text",
"text": "This is a sample notification."
}
}' \
-H 'content-type: application/json' \
--user 'keyId:keySecret'