<Sms>
The <Sms>
verb sends an SMS message to a phone number during a phone call.
Verb Attributes
Attribute | Description |
---|---|
to optional | The to attribute takes a valid phone number as a value. SignalWire 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. NOTE: sending to short codes is not currently supported.Phone numbers should be formatted with a + and country code e.g., +17275551212 (E.164 format). |
from optional | The from attribute takes a valid phone number as an argument. This number must be a phone number that you've purchased from or ported to SignalWire. When sending an SMS during an incoming call, from defaults to the called party. When sending an SMS during an outgoing call, from defaults to the calling party. This number must be an SMS-enabled phone number assigned to your account. If the phone number isn't SMS-enabled, then the <Sms> verb will not send an SMS message. |
action optional | The action attribute takes a URL as an argument. After processing the <Sms> verb, SignalWire will make a GET or POST request to this URL with the form parameters SmsStatus and SmsSid . Using an action URL, your application can receive synchronous notification that the message was successfully enqueued.If you provide an action URL, SignalWire will use the cXML received in your response to the action URL request to continue the current call. Any cXML verbs occurring after an <Sms> which specifies an action attribute are unreachable.If no action is provided, <Sms> will finish and SignalWire will move on to the next cXML verb in the document. If there is no next verb, SignalWire will end the phone call. Note that this is different from the behavior of <Record> and <Gather> . <Sms> does not make a request to the current document's URL by default if no action URL is provided. See below for request parameters. |
method optional | The method attribute specifies whether the request to action is a GET or a POST . Valid values are GET or POST . Default value is POST . |
statusCallback optional | The URL to make requests to for each statusCallbackEvent event. See below for request parameters. The statusCallback attribute takes a URL as an argument. When the SMS message is actually sent, or if sending fails, SignalWire will make an asynchronous POST request to this URL with the parameters SmsStatus and SmsSid . Note, statusCallback always uses HTTP POST to request the given url. |
Request parameters for the action
URL
The action
URL request contains the Standard Request Parameters as well as:
Parameter | Description |
---|---|
SmsSid string | The SID for the Sms message. |
SmsStatus string | The current status of the Sms message. This is usually sending . But if you provide an invalid number, this is invalid . |
Request parameters for statusCallback
The statusCallback
request contains the Standard Request Parameters as well as:
Parameter | Description |
---|---|
SmsSid string | The SID for the Sms message. |
SmsStatus string | The current status of the Sms message. Either sent or failed . |
Nouns
The noun of a cXML verb is nested within the verb upon which the verb acts. <Sms>
has the following nouns:
Noun | Description |
---|---|
plain text | The text of the SMS message you want to send. Must be less than 1600 characters. |