Reference Turnkey Applications Tutorials Visual Designer
Reference Turnkey Applications Tutorials Visual Designer
    • REST API
      • Overview
      • API Endpoint
      • Authentication
      • Requests
      • Responses
      • Paging
      • Reason Codes Dictionary
    • Management APIs
      • Accounts
      • Identity Access Management BETA
        • Identity Access Management Overview
        • Identity Access Management API
          • User Management
            • Create a User
            • Update a User
            • Retrieve a User
            • Delete a User
          • API Keys Management
            • Create an API Key
            • Update an API Key
            • Retrieve an API Key
            • Delete an API Key
      • Applications
      • Clients
        • Create a Client
        • Delete a Client
        • Change Client’s Password
        • Get a List of Available Clients
      • Incoming Phone Numbers
        • IncomingPhoneNumber Instance Resource
        • IncomingPhoneNumbers List Resource
        • Local IncomingPhoneNumber Factory Resource
        • Toll-Free IncomingPhoneNumber Factory Resource
        • Mobile IncomingPhoneNumber Factory Resource
        • Attach a phone number to an application
        • Enable Incoming MMS for an Application
        • Delete a phone number
        • List of Phone Numbers
        • Incoming Phone Number Regex Support
      • Notifications
      • Usage Records
      • Trace Records
    • Voice
      • Calls
        • Call List Resource URI
        • Making a Call
        • Modifying Live Calls
        • Examples
        • List Filter
        • Paging Information
      • Conference Management
        • Supported Operations
        • Conference List Resource URI
      • Conference Participants Management
        • Participants List Resource URI
      • Gather DTMF
      • Gather Speech
      • Say
      • Play
      • Hold
      • Recordings
      • Refers
        • Resource Properties
        • Supported Operations
        • Paging Information
      • Resume
      • SIP Refer Support
    • Messages API - BETA
      • Overview
      • Channel Identities
      • Send Message
      • Status Callback Parameters
      • Status Callback Events
      • Receive Message
        • Incoming Message Request Parameters
      • Get Message List
      • Get Single Message
      • Message Attributes
      • Status Description
    • SMS
      • Messages
        • Send SMS
        • Get SMS List
        • Get single SMS Information
        • SMS Attributes
      • Error Codes
    • Email
    • RCML
      • Overview
        • Interacting with Your Application
        • RCML Verbs
      • Dial
        • Client
        • Conference
        • Number
        • SIP
      • Email
      • Gather
      • Say
      • Play
      • SMS
      • Message - Beta
      • Hold
      • Resume
      • Hangup
      • Pause
      • Redirect
      • Record
      • Reject
      • Refer
    • Visual Designer API
      • List Application Templates
      • :List a Specific Application Template
      • Create a Visual Designer Application
      • Get Application Details
      • Save Application Changes
      • Create Application Parameters
      • List Application Parameters
      • Delete Application Parameters
      • Upload Application Media Files
      • List Application Media Files
      • Play Application Media Files
      • Delete Application Media Files
      • Get Application Logs
      • Delete Application Logs
      • Get Application Settings
      • Modify Application Settings
      • Rename an Application
      • Delete an Application
      • Get Visual Designer Configuration
    • Turnkey Apps APIs
      • Smart 2FA
        • Sending One-Time Passwords
        • Verifying One-Time Passwords
        • Cancel One-Time Passwords
        • Session Detail Record (SDR)
        • Get list of One-Time Passwords
        • Get a Single One-Time Password
        • Usage Record One-Time Passwords
        • Common Response Error Code
        • Limit
          • Create Limit
          • Update Limit
          • Delete Limit
          • Get List of Limits
      • Call Queuing
      • Auto Attendant
        • Users
        • Announcement
        • Auto Attendant System
        • Menu
        • Schedule
        • Phone Number
        • Usage Records
        • Third Party Integration
      • Number Masking
        • Application
        • Mask Number Pool
        • Context
        • Participants
        • Interactions
        • Usage Records
      • Task Router
docs 1.0
  • docs
    • 1.0
  • docs
  • Enterprise:RCML
  • Enterprise:SMS

SMS

SMS

The <Sms> verb sends an SMS message to a phone number during a phone call.

SMS Attributes

Name Allowed values Default value

to

Phone number

See below

from

Phone number

See below

action

A relative or absolute URL address

None

method

GET, POST

POST

statusCallback

any url

none

statusCallbackMethod

GET, POST

POST

to

The 'to' attribute takes a valid E.164 phone number as a value. CPaaS will send an SMS message to this number. When sending an SMS during an incoming call, 'to' defaults to the caller. When sending an SMS during an outgoing call, 'to' defaults to the called party. The value of 'to' must be a valid phone number.

from

The from attribute takes a valid E.164 or alphanumeric phone number as an argument. Alphanumeric numbers are limited to 11 characters. Accepted characters include both upper and lower case ASCII letters, the digits from 0 to 9, and space: [A-Za-z0-9 ].

When sending an SMS during an incoming call, from defaults to the calling party. When sending an SMS during an outgoing call, from defaults to the called party.

action

The 'action' attribute takes a URL address as an argument. After processing the <Sms> verb, CPaaS will make a GET or POST request to this URL with the form parameters 'MessageStatus' and 'MessageSid'. Using an 'action' URL, your application can receive synchronous notification that the message was successfully enqueued or not.

If you provide an 'action' URL, CPaaS will use the RCML received in your response to the 'action' URL request to continue the current call. Any RCML verbs occuring after an <Sms> which specifies an 'action' attribute are unreachable. If no 'action' is provided, <Sms> will finish and CPaaS will move on to the next RCML verb in the document. If there is no next verb, CPaaS will end the phone call.

method

The 'method' attribute takes the value 'GET' or 'POST'. This tells CPaaS whether to request the 'action' URL via HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute.

Request Parameters

Parameter Description

MessageSid

The Sid for the SMS message.

MessageStatus

The current status of the SMS message. Currently the status will be Queued

statusCallback

The statusCallback attribute allows you to specify a URL for CPaaS to send webhook requests to, on each event of message delivery (triggered for status callbacks).

statusCallbackMethod

The statusCallbackMethod attribute lets you specify which HTTP method CPaaS should use when requesting the URL in the statusCallback attribute. The default is POST.

statusCallback Events

Event Possible status

sent

sent

completed

failed, delivered, undelivered

StatusCallback Parameters

Parameter Description Example value

MessageSid

The Sid of the SMS message.

SMc5b1b09cf2b14ffe985461c3587f4c38

MessageStatus

Last status known for this message.

delivered

From

From address of the message (message sender)

8888001

To

To address of the message (message receiver)

8888002

Body

The message body.

Hello world

AccountSid

The Account Sid.

ACa272717421604a9d924a5837aa23711b

ErrorCode

Error code, if any. This parameter is optional.

30001

Nesting

The <Sms> verb can’t have any other verbs or nouns nested.

Examples

Below is a simple example of how you can use the <Sms> verb.

<Response>
    <Sms>Hello World!</Sms>
</Response>

The next RCML example showcases how you can use From, To and statusCallback.

<Response>
    <Sms from="8888001" to="8888002" statusCallback="http://status.callback.url" statusCallbackMethod="POST">Hello World !!!</Sms>
</Response>
Platform

Programmable Voice

Programmable SMS

Turnkey Applications

Smart 2FA

Call Queue

Auto Attendant

Number Masking

Task Router

Campaign Manager

Learn

Terms And Conditions

About

ABOUT

CONTACT US

© 2020, All rights reserved.