attachRuleTemplateToLinks¶
Request Method: PUT
Description: Attach a Rule Template to the specified link(s). Any Rule Template found in the "Calling Rule Templates" section of the portal can be applied to a link
URL: https://api.iovox.com:444/Links?v=3&method=attachRuleTemplateToLinks
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>Call Whisper Both</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>1</rule_id>
<rule_type>play</rule_type>
<rule_label>Welcome</rule_label>
<sound_files>
<sound_file>Sound Group 1|whisper caller</sound_file>
</sound_files>
</rule>
<rule>
<rule_id>2</rule_id>
<rule_type>messageKeypress</rule_type>
<rule_label>Options</rule_label>
<play>
<sound_files>
<sound_file>Sound Group 1|whisper called</sound_file>
<sound_file>Sound Group 2|whisper caller</sound_file>
</sound_files>
</play>
</rule>
<rule>
<rule_id>3</rule_id>
<rule_type>call</rule_type>
<rule_label>Call</rule_label>
<contact>
<contact_id>1</contact_id>
<phone_number>4420754545454</phone_number>
</contact>
<send_call_alert>ALL_CALLS</send_call_alert>
<record_call>TRUE</record_call>
</rule>
</rules_variable>
</request>
Payload Description¶
Parameter | Description | Default Value | Data Type | Mandatory |
template_name | The name of the 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 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 | |
rules_variable > rule > send_call_alert | NONE – don’t send an alert MISSED_CALLS – send an email for missed calls MISSED_CALLS_NO_WITHHELD – send email alerts for missed calls but only when the call origin is not withheld ALL_CALLS – send an email alert for all received calls regardless of result | STRING | NO | |
rules_variable > rule > record_call | TRUE/FALSE. If set to TRUE, the call will be recorded. If set to FALSE, the call will not be recorded | STRING | NO |
Rule Specific Payload Description¶
The following is dependent on the Rule Template being applied. Rules with custom fields will require one of more items from the payload below
Parameter | Description | Default Value | Data Type | Mandatory For |
pre_whisper_caller | A Pre Call Whisper to the Caller | XML | N/A | |
pre_whisper_called | A Pre Call Whisper to the Called party | XML | N/A | |
label | When inside pre_whisper_caller or pre_whisper_called, the Label of the Whisper to use | STRING | pre_whisper_caller, pre_whisper_called | |
call | Initiate a Direct Call to the specified Contact | XML | N/A | |
rule > contact > contact_id | The Contact ID to call | STRING | call | |
rule > contact > phone_number | The Phone Number to call. This must belong to the contact_id specified | INTEGER | call |
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 (Whisper Label) Empty | Add Whisper Label to Rule Detail x of y |
400 | Rule Detail x of y (Whisper Label) does not exist | Correct Whisper Label In Rule Detail x of y |
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 | Multiple matches for Sound Label (x) Sound Group: (y,z) | Specify the sound group (y,z) for this sound label (x) |
400 | Phone Number not an integer | Correct Phone number |
400 | Send Call Alert x of y invalid | Correct Call alert field |
400 | Record call x of y invalid | Correct Record call field |
500 | Internal Server Error | Retry later |