attachSMSTemplateToLinks¶
Request Method: PUT
Description: Attach a SMS Rule Template to the specified link(s). Any Rule Template found in the "SMS Rule Templates" section of the portal can be applied to a link
URL: https://api.iovox.com:444/Links?v=3&method=attachSMSTemplateToLinks
The following parameters can be sent in the querystring
Parameter | Description | Default Value | Data Type | Mandatory |
v | API version to use | INTEGER | YES |
Payload¶
The following XML payload must be sent with an attachRuleTemplateToLinks request:
<?xml version="1.0" encoding="utf-8"?>
<request>
<template_name>SMS</template_name>
<overwrite_existing>TRUE</overwrite_existing>
<link_ids>
<link_id>100</link_id>
<link_id>130</link_id>
<link_id>200</link_id>
</link_ids>
<!-- any For more information how to get the rules_variables go to getVariableRulesOfTemplate API method -->
<rules_variable>
<rule>
<rule_id>sendSms_1</rule_id>
<rule_type>sendSms</rule_type>
<rule_label>sendSms</rule_label>
<contact>
<contact_id>1</contact_id>
<phone_number>4420754545454</phone_number>
</contact>
</rule>
</rules_variable>
</request>
Payload Description¶
Parameter | Description | Default Value | Data Type | Mandatory |
template_name | The name of the SMS Rule Template to attach | STRING | YES | |
overwrite_existing | TRUE/FALSE. If set to TRUE and the Link already has a Template attached then that Template will be overwritten. If set to FALSE and the Link already has a Template attached, an error will be thrown | STRING | YES | |
link_ids > link_id | The Link ID of the Link to attach the SMS Rule Template to | YES | ||
rules_variable > rule > rule_id | ID of the Rule to attach | INT | YES | |
rules_variable > rule > rule_type | Type of the Rule to attach | STRING | YES | |
rules_variable > rule > rule_label | Label of the Rule to attach | STRING | YES |
Result¶
Error Result¶
HTTP Code | Error String | Resolution |
400 | API Version Empty | Add a value for the v parameter in the query string |
400 | API Version Invalid | Correct v parameter |
400 | Overwrite Existing Empty | Add overwrite_existing to the query string |
400 | Overwrite Existing Invalid | Correct overwrite_existing to be TRUE or FALSE |
400 | Request Method must be PUT. x attempted | Switch request method x to PUT |
400 | XML Empty | Add xml to the request body |
400 | XML parse error. x at line y, column z | Correct XML at point x on line y, column z |
400 | Template Name Empty | Add Template Name |
400 | Template Name does not exist | Correct Template Name |
400 | Link IDs Empty | Add one or more link_ids to the request |
400 | Link ID x of y Empty | Add Link ID to Rule Detail x of y |
400 | Link ID x of y does not exist | Correct link_id x (current) of y (total) |
400 | Link IDs already have rules attached: x,y,z | Remove Link IDs x, y and z from the XML or set overwrite_existing to TRUE |
400 | Duplicate Link ID Received | Remove duplicates from Link ID lis |
400 | Rule Detail x of y (Contact ID) Empty | Add Contact ID to Rule Detail x of y |
400 | Rule Detail x of y (Contact ID) does not exist | Correct Contact ID in Rule Detail x of y |
400 | Rule Detail x of y (Phone Number) Empty | Add Phone Number to Rule Detail x of y |
400 | Rule Detail x of y (Phone Number) does not belong to contact z | Correct Phone Number in Rule Detail x of y to match a phone number from Contact ID z |
400 | Rule Detail x of y (Phone Number) not an is not internationalised | Correct Phone Number in Rule Detail x of y so it is in an internationalised format |
400 | Rule Details Empty. | Add rule details. |
400 | Phone Number not an integer | Correct Phone number |
500 | Internal Server Error | Retry later |