attachVoxnumberToLink¶
Request Method: PUT
Description: Attaches a VoxNumber to a link
URL: https://api.iovox.com:444/Links?v=3&method=attachVoxnumberToLink
The following parameters must be sent in the querystring
Parameter | Description | Default Value | Data Type | Mandatory |
v | API version to use | INTEGER | YES |
Payload¶
One of the following XML formats must be sent with an attachVoxnumberToLink request. Requests should match all XML node names in at least one of these examples.
Example 1: Assign any VoxNumber in LONDON to Link ID 333
<?xml version="1.0" encoding="utf-8"?>
<request>
<link>
<link_id>333</link_id>
<method>BY AREA</method>
<voxnumber_idd>44</voxnumber_idd>
<area_code>20</area_code>
</link>
</request>
Example 2: Assign any 0845 in country code 44 to Link ID 444
<?xml version="1.0" encoding="utf-8"?>
<request>
<link>
<link_id>444</link_id>
<method>BY VOXNUMBER</method>
<full_voxnumber>4423012565866</full_voxnumber>
</link>
</request>
Example 3: Assign the closest number from Westminster in London, UK (postcode SW1A 0AA) to Link ID 555. The following will assign any available VoxNumber who's area code covers the postcode SW1A 0AA, or if not possible it will assign a number as close as possible within 20 Kms (fallback distance).
<?xml version="1.0" encoding="utf-8"?>
<request>
<link>
<link_id>555</link_id>
<method>BY POSTCODE</method>
<voxnumber_country>UNITED KINGDOM</voxnumber_country>
<postcode>SW1A 0AA</postcode>
<fallback_area_distance>20</fallback_area_distance>
</link>
</request>
Note: You can attach different Links in the same request to perform all actions at once, such as:
<?xml version="1.0" encoding="utf-8"?>
<request>
<link>
<link_id>333</link_id>
<method>BY AREA</method>
<voxnumber_idd>44</voxnumber_idd>
<area_code>20</area_code>
</link>
<link>
<link_id>444</link_id>
<method>BY AREA</method>
<voxnumber_idd>44</voxnumber_idd>
<area_code>845</area_code>
</link>
</request>
Payload Description¶
Field | Description | Default | Data Type | Manditory |
---|---|---|---|---|
link_id | The Link ID to attach the VoxNumber to | STRING | YES | |
method | The way the VoxNumber is attached, can be BY AREA, BY VOXNUMBER, BY POSTCODE | STRING | YES |
method:BY AREA¶
Field | Description | Default | Data Type | Manditory |
---|---|---|---|---|
voxnumber_idd | The VoxNumber's associated International Direct Dialing code | NUMBER | YES | |
area_code | The VoxNumber's associated area code. It is mandatory to use voxnumber_idd alongside this to define the country of the area code | NUMBER | YES | |
fallback_city | If not sufficient number in the area_code, will attach numbers in other area codes from the same city. Only available if method is "BY AREA" | FALSE | BOOLEAN | NO |
fallback_region | If not sufficient number in the area_code, will attach numbers in other area codes from the same city. Only available if method is "BY AREA" and in Canada and United States | FALSE | BOOLEAN | NO |
fallback_country | The VoxNumber's associated area code. It is mandatory to use voxnumber_idd alongside this to define the country of the area code | FALSE | BOOLEAN | NO |
method:BY VOXNUMBER¶
Field | Description | Default | Data Type | Manditory |
---|---|---|---|---|
full_voxnumber | The Full Voxnumber we want to apply. It is needed that the voxnumber which is applied is in your account. | STRING | YES |
method:BY POSTCODE¶
Field | Description | Default | Data Type | Manditory |
---|---|---|---|---|
voxnumber_country | The VoxNumber's associated country name. List of supported countries for Postcode search | STRING | YES | |
postcode | The full postcode you are searching for. Postcodes will be grouped by out-code (i.e. the first half of the postcode) to match available stock. For example, if you require a VoxNumber in W11 3EP for Link 1 and a VoxNumber in W11 4FQ for Link 2 and have only 1 VoxNumber in your account in London (020) both of these will fall back to the same closest matching area code if a fallback_area_distance is specified as they are both in the outcode W11 | STRING | YES | |
fallback_area_distance | If there is no VoxNumber available for the exact postcode, the fallback distance will return the closest within the range. Ex. If the fallback_area_distance is set to 20, the VoxNumber attached can be 15Kms away from the postcode, but not 25Kms. | 0 | NUMBER (in Kilometers) | NO |
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 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 | Method x of y Empty | Add method x (item) of y (total) to the request |
400 | Method x of y Invalid | Correct method x (item) of y (total) to be "BY VOXNUMBER", "BY AREA" |
400 | Request Empty | Add at least one link_id to the request |
400 | Link ID x of y empty | Add link_id x (item) of y (total) |
400 | Link ID x of y does not exist | Correct link_id x (item) of y (total) |
400 | Duplicate Link ID Received | Remove any duplicated link_ids from the XML |
400 | Link ID x of y already has a Voxnumber | Remove the link from the XML |
400 | Method x of y Empty | Add method x (item) of y (total) to the request |
400 | Method x of y Invalid | Correct method x (item) of y (total) to be "BY AREA", "BY VOXNUMBER" or "BY POSTCODE" |
400 | VoxNumber IDD x of y Empty | Add voxnumber_idd x (item) of y (total) |
400 | VoxNumber IDD x of y Invalid | Correct voxnumber_idd x (item) of y (total) |
400 | Voxnumber x of y Empty | Add an existing voxnumber to request x (item) of y (total) or change method |
400 | Voxnumber x of y is not an Integer | Correct the full voxnumber to request x (item) of y (total) or change method |
400 | VoxNumber x of y not available | Correct the full voxnumber to request x (item) of y (total) |
400 | Duplicate Voxnumber Received | Correct the duplicated full voxnumber in the XML |
400 | Area Code x of y Empty | Add a correct area code to request x (item) of y (total) or change method |
400 | Area Code x of y not an integer | Correct the area code request x (item) of y (total) or change method |
400 | Fallback City x of y Invalid | Correct the fallback city to be TRUE, FALSE. |
400 | Fallback Region x of y Invalid | Correct the fallback region to be TRUE, FALSE. |
400 | Fallback Country 1 of 1 Invalid | Correct the fallback country to be TRUE, FALSE. |
400 | Insufficient VoxNumbers available in Area Code x and Voxnumber IDD y | Buy more VoxNumbers in city x for Voxnumber IDD y or remove some requests until the required amount falls beneath the total VoxNumbers available in your account. Bare in mind that it counts the UNASSIGNED full_voxnumbers in your account |
400 | There is no VoxNumber available in your account for this Postcode or the fallback area | Extra VoxNumbers need to be purchased in this area. |
400 | The country x is not supported for Postcode search | Choose a supported country of use an other "method". Currently only UK postcodes are supported |
400 | Postcode x does not exist in country id y | Change the postcode for an existing one. |
500 | Internal Server Error | Retry later |