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:

ParameterDescriptionDefault ValueData TypeMandatory
vAPI version to use
INTEGERYES

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 NameDescriptionDefault ValueData TypeMandatory
numberNumber you want to block. Can be a e164 format phone number (e.g. 442071002003), WITHHELD, a SIP address or * for all
STRINGYES
in_or_outInbound or Outbound
STRINGYES
operatorOperator for this number. Can be STARTSWITH or EQUALS
STRINGYES
defaultThe default behaviour for this entry. BLOCK will be block everything, ALLOW will be allow everything.
STRINGYES
rules>rule>link_idsThe Link IDs you want to apply this rule to
STRINGNO
rules>rule>time_templateThe Time Template you want to apply to the links
STRINGNO
rules>rule>blocking_typeThe behaviour of this rule.
STRINGNO, unless a rule is specified

Result

Error Result

HTTP CodeError StringResolution
400API Version EmptyAdd a value for the v parameter in the query string
400API Version InvalidCorrect v parameter
400Request Method must be POST. x attemptedSwitch request method x to POST
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
400Request EmptyAdd at least one Blocked Number to the request
400Blocked Number x of y EmptyAdd a Blocked Number x (item) of y (total)
400in_or_out x of y EmptyAdd a In or Out parameter x (item) of y (total)
400Operator x of y EmptyAdd an Operator x (item) of y (total)
400Default x of y EmptyAdd a Default x (item) of y (total)
400Blocked Number x of y InvalidCorrect Blocked Number x (item) of y (total)
400in_or_out x of y InvalidCorrect In or Out parameter x (item) of y (total)
400Operator x of y InvalidCorrect Operator x (item) of y (total)
400Default x of y InvalidCorrect Default x (item) of y (total)
500Internal Server ErrorRetry later

Success Result.

HTTP/1.1 201 Created