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

ParameterDescriptionDefault ValueData TypeMandatory
vAPI version to use
INTEGERYES

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

ParameterDescriptionDefault ValueData TypeMandatory
template_nameThe name of the SMS Rule Template to attach
STRINGYES
overwrite_existingTRUE/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
STRINGYES
link_ids > link_idThe Link ID of the Link to attach the SMS Rule Template to

YES
rules_variable > rule > rule_idID of the Rule to attach
INTYES
rules_variable > rule > rule_typeType of the Rule to attach
STRINGYES
rules_variable > rule > rule_labelLabel of the Rule to attach
STRINGYES

Result

Error Result

HTTP CodeError StringResolution
400API Version EmptyAdd a value for the v parameter in the query string
400API Version InvalidCorrect v parameter
400Overwrite Existing EmptyAdd overwrite_existing to the query string
400Overwrite Existing InvalidCorrect overwrite_existing to be TRUE or FALSE
400Request Method must be PUT. x attemptedSwitch request method x to PUT
400XML EmptyAdd xml to the request body
400XML parse error. x at line y, column zCorrect XML at point x on line y, column z
400Template Name EmptyAdd Template Name
400Template Name does not existCorrect Template Name
400Link IDs EmptyAdd one or more link_ids to the request
400Link ID x of y EmptyAdd Link ID to Rule Detail x of y
400Link ID x of y does not existCorrect link_id x (current) of y (total)
400Link IDs already have rules attached: x,y,zRemove Link IDs x, y and z from the XML or set overwrite_existing to TRUE
400Duplicate Link ID ReceivedRemove duplicates from Link ID lis
400Rule Detail x of y (Contact ID) EmptyAdd Contact ID to Rule Detail x of y
400Rule Detail x of y (Contact ID) does not existCorrect Contact ID in Rule Detail x of y
400Rule Detail x of y (Phone Number) EmptyAdd Phone Number to Rule Detail x of y
400Rule Detail x of y (Phone Number) does not belong to contact zCorrect Phone Number in Rule Detail x of y to match a phone number from Contact ID z
400Rule Detail x of y (Phone Number) not an is not internationalisedCorrect Phone Number in Rule Detail x of y so it is in an internationalised format
400Rule Details Empty.Add rule details.
400Phone Number not an integerCorrect Phone number
500Internal Server ErrorRetry later

Success Result

HTTP/1.1 204 No Content