sendSms

The sendSms sends an SMS message to a Contact selected in the Rule.

Structure

This rule does not have extra elements as you can see in the following XML.

 <sendSms id="sendSms_1" label="sendSms_1" from="$_partnerName" destinationPhoneNumber="?" destinationContactId="?" destinationContactName="?" message="Text" />

The attributes in this rule are:

AttributeDescriptionMandatory

from

The Origin the Message is being sent from. We only allow to set this attribute as $_partnerName.

YES

message

The text we want to send in the message

NO

destinationPhoneNumber

This is the destination phone number to which the message should be sent. This phone number must belong to a contact, if not the message will not be sent so this field need to be in combination of destinationContactId or destinationContactName

YES

destinationContactId

This is the unique ID of the Contact.

YES

destinationContactName

This is the Contact's Display Name. You can have multiple contacts with the same Name so if you decide to use this attribute in combination with destinationPhoneNumber then the first Contact which mataches this name will be taken if there are multiple

YES
smsAlertDestinationTypeAllows sending of SMS email alerts to the PRIMARY or SECONDARY email address of a Contact. Possible values are PRIMARY, SECONDARY, BOTH. Defaults to PRIMARY.NO
smsAlertDestinationBehaviourWhen a Contact has multiple email addresses of a certain type, this attribute allows deciding on whether only the FIRST one receives the SMS email alert, or ALL will receive the missed call alerts. Possible values are FIRST, ALL. Defaults to FIRST.NO
sendSmsAlert

Should an SMS email alert be sent? Possible values are NONE, FAILED_SMS, ALL_SMS.

NO
smsAlertEmailTemplateNameThe email template which will be used when sending SMS email alerts.NO
smsAlertFromThe from email address which will be used to send the SMS email alerts.NO
smsAlertFromNameThe from name which will be used to send the SMS email alerts.NO
callbackUrlURL we will send the delivery receipts to.NO
callbackUrlHeadersAdditional headers we will be sending with the delivery receipt call back. If multiple headers need to be included, please separate them by ",".NO

Examples

Send an SMS with a fixed Contact by name and phone number.

We are selecting a Contact by destinationPhoneNumber and destinationContactName so if you have duplicated contact names then the first Contact for that combination will be taken (we advise to use destinationContactId). In the example, every time a caller reach this rule, Bob will received a message saying "This is a message is from IOVOX!!".

<sendSms label="sendSms_1" from="$_partnerName" id="sendConfirmationSms" destinationPhoneNumber="447400000000" destinationContactName="Bob" message="This is a message from IOVOX!!" />

Send an SMS with a fixed Contact by id and phone number.

Same as above but this time using the destinationContactId to refer to the Contact

<sendSms label="sendSms_1" from="$_partnerName" id="sendConfirmationSms" destinationPhoneNumber="447400000000" destinationContactId="1" message="This is a message from IOVOX!!" />

Send an SMS with a variable Value

If you want to apply the same rule to different Contacts across multiple Links then we will need to set the rule with variable values.

<sendSms label="sendSms_1" from="$_partnerName" id="sendConfirmationSms" destinationPhoneNumber="?" destinationContactName="?" message="This is a message from IOVOX!!" />

Send an SMS with Delivery Receipt callback

If you want to receive delivery receipts for the SMS's which are sent from within a Call Flow, then the callbackUrl needs to be added. You can send additional headers in this callback by adding the callbackUrlHeaders attribute.

<sendSms label="sendSms_1" from="$_partnerName" id="sendConfirmationSms" destinationPhoneNumber="447400000000" destinationContactName="1" message="This is a message from IOVOX!!" callbackUrl="https://my.dlr.callback.iovox.com/dlr" callbackUrlHeaders="Content-Type: application/json,X-Custom-Header: iovox" />

Error Result

HTTP Code
Error String
Resolution
400

You don't have access to this feature: sendSms

Contact to your Account Manager about this issue.

400Rule ID EmptySet the value of the id attribute
400Rule Label EmptySet the value of the label attribute
400Message EmptySet a value for the message attribute
400Sender EmptySet a value for the from attribute
400Sender InvalidSet the sender to $_partnerName
400You need to select a ContactThe contact is not been set in the Send SMS Rule
400Contact cannot have Variable and Fix details at the same timeThe contact details cannot have variables values and fixed values at the same time. Please correct the attributes related to the Contact
400Phone Number InvalidThe destinationPhoneNumber attribute contains an Invalid value
400Destination Contact does not existThe Contact does not exist in your account.
400Sender is not internationalisedThe from attribute needs to contain an internationalised number for example: 44741111111