initiateCall¶
Request Method: POST
Description: Initiates a call which will follow the Calling Rules currently attached to the specified Link ID
URL: https://api.iovox.com:444/Calling?v=3&method=initiateCall
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 initiateCall request:
<?xml version="1.0" encoding="utf-8"?>
<request>
<link_id>link123</link_id>
<call_variables>
<call_destination>449789123123</call_destination>
<my_custom_var>Bob</my_custom_var>
<the_custom_var>Smith</the_custom_var>
<another_custom_var>1234</another_custom_var>
</call_variables>
</request>
It is also possible to traverse through an IVR by adding the keypresses to the numbers being dialed. For example, if the IVR would say "Press one for the support department, two for the sales department", you could add ",1" behind the number to automatically press 1 in the IVR. The keypresses can also be chained together, for example ",,1,,2".
Character | Description |
---|---|
, | Adds a 2 second pause. The initial pause starts counting from the moment the call is ANSWERED. |
1 | Sends the number 1 as a keypress to the person or system who ANSWERED the call. |
Example payloads:
<?xml version="1.0" encoding="utf-8"?>
<request>
<link_id>link123</link_id>
<call_variables>
<call_destination>449789123123,1</call_destination>
</call_variables>
</request>
A "delay" variable may also be set in addition to custom variables. This will delay the call N minutes into the future.
<?xml version="1.0" encoding="utf-8"?>
<request>
<link_id>link123</link_id>
<call_variables>
<call_destination>449789123123,,1,,2</call_destination>
<delay>30</delay>
</call_variables>
</request>
Payload Description¶
Node Name | Description | Default Value | Data Type | Mandatory |
link_id | The Link ID whose Calling Rules to follow | STRING | YES | |
call_variables | A list of Call Variables. These will be used by any variable fields in the Calling Rules flow. This is only mandatory if the Calling Rules require any of these variables to be set. If that is the case, the XML node names here must match the variables names in the Call Flow. call_destination is mandatory if using a Call based Rule Template. The "delay" variable is optional and must be an integer. | STRING | 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 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 link_id and any mandatory Call Variables to the request | ||
400 | Link ID Empty | Add link_id to the XML | ||
400 | Link ID does not exist | Correct link_id to be an existing Link ID | ||
400 | Link ID has no Calling Rules | Add Calling Rules to link_id using Rules::attachRuleTemplateToLinks or change to a Link ID that has Calling Rules attached | ||
400 | Call Variable x Empty | Add x as a parameter under call_variables | ||
400 | The number of calls allowed has been exceeded | The caller cannot make more calls for a period of time. | ||
500 | Internal Server Error | Retry later |
Success Result¶
HTTP Code: 201