createBlockedNumbers¶
Request Method: POST
Description: Create new Blocked Number(s)
URL: https://api.iovox.com:444/Rules?v=3&method=createBlockedNumbers
The following parameters must 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 createBlockedNumbers request:
<?xml version="1.0" encoding="utf-8"?>
<request>
<blocked_number> <!-- Block all calls from this number at all times to all Links -->
<number>447429651520</number>
<in_or_out>IN</in_or_out>
<operator>EQUALS</operator>
<default>BLOCK</default>
<rules />
</blocked_number>
<blocked_number> <!-- Block all outbound calls to France -->
<number>33</number>
<in_or_out>OUT</in_or_out>
<operator>STARTSWITH</operator>
<default>BLOCK</default>
<rules />
</blocked_number>
<blocked_number> <!-- Allow all calls from this number irrespective of Link and Time of Call -->
<number>447429651521</number>
<in_or_out>IN</in_or_out>
<operator>EQUALS</operator>
<default>ALLOW</default>
<rules />
</blocked_number>
<blocked_number> <!-- Block all calls from this number, but allow if call is to Link IDs 32 and 33 during Christmas Time Template or at any time to Link IDs 34 or 35 -->
<number>447429651522</number>
<in_or_out>IN</in_or_out>
<operator>EQUALS</operator>
<default>BLOCK</default>
<rules>
<rule>
<link_ids>
<link_id>32</link_id>
<link_id>33</link_id>
</link_ids>
<time_template>Christmas</time_template>
<blocking_type>ALLOW</blocking_type>
</rule>
<rule>
<link_ids>
<link_id>34</link_id>
<link_id>35</link_id>
</link_ids>
<time_template />
<blocking_type>ALLOW</blocking_type>
</rule>
</rules>
</blocked_number>
<blocked_number> <!-- Allow all calls from this number, but block if calling Link IDs 32 and 33 during Christmas Time Template or Link IDs 34 and 35 at any time -->
<number>447429651523</number>
<in_or_out>IN</in_or_out>
<operator>EQUALS</operator>
<default>ALLOW</default>
<rules>
<rule>
<link_ids>
<link_id>32</link_id>
<link_id>33</link_id>
</link_ids>
<time_template>Christmas</time_template>
<blocking_type>BLOCK</blocking_type>
</rule>
<rule>
<link_ids>
<link_id>34</link_id>
<link_id>35</link_id>
</link_ids>
<time_template />
<blocking_type>BLOCK</blocking_type>
</rule>
</rules>
</blocked_number>
<blocked_number> <!-- Allow all calls from WITHHELD but block if it is during Christmas Time Template and calling Link IDs 36 and 37 -->
<number>WITHHELD</number>
<in_or_out>IN</in_or_out>
<operator>EQUALS</operator>
<default>ALLOW</default>
<rules>
<rule>
<link_ids>
<link_id>36</link_id>
<link_id>37</link_id>
</link_ids>
<time_template>Christmas</time_template>
<blocking_type>BLOCK</blocking_type>
</rule>
</rules>
</blocked_number>
<blocked_number> <!-- Block all calls from WITHHELD but allow if it is during Christmas Time Template and calling Link IDs 38 and 39 -->
<number>*</number>
<in_or_out>IN</in_or_out>
<operator>EQUALS</operator>
<default>BLOCK</default>
<rules>
<rule>
<link_ids>
<link_id>38</link_id>
<link_id>39</link_id>
</link_ids>
<time_template>Christmas</time_template>
<blocking_type>ALLOW</blocking_type>
</rule>
</rules>
</blocked_number>
</request>
Payload Description:¶
The following parameters can be sent in the querystring
Node Name | Description | Default Value | Data Type | Mandatory |
number | Number you want to block. Can be a e164 format phone number (e.g. 442071002003), WITHHELD, a SIP address or * for all | STRING | YES | |
in_or_out | Inbound or Outbound | STRING | YES | |
operator | Operator for this number. Can be STARTSWITH or EQUALS | STRING | YES | |
default | The default behaviour for this entry. BLOCK will be block everything, ALLOW will be allow everything. | STRING | YES | |
rules>rule>link_ids | The Link IDs you want to apply this rule to | STRING | NO | |
rules>rule>time_template | The Time Template you want to apply to the links | STRING | NO | |
rules>rule>blocking_type | The behaviour of this rule. | STRING | NO, unless a rule is specified |
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 | Request Method must be POST. x attempted | Switch request method x to POST |
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 | Request Empty | Add at least one Blocked Number to the request |
400 | Blocked Number x of y Empty | Add a Blocked Number x (item) of y (total) |
400 | in_or_out x of y Empty | Add a In or Out parameter x (item) of y (total) |
400 | Operator x of y Empty | Add an Operator x (item) of y (total) |
400 | Default x of y Empty | Add a Default x (item) of y (total) |
400 | Blocked Number x of y Invalid | Correct Blocked Number x (item) of y (total) |
400 | in_or_out x of y Invalid | Correct In or Out parameter x (item) of y (total) |
400 | Operator x of y Invalid | Correct Operator x (item) of y (total) |
400 | Default x of y Invalid | Correct Default x (item) of y (total) |
500 | Internal Server Error | Retry later |