To setup and start a call using the JSONP interface, you need to issue a GET request to /call/2.0/<contactId>/<userPhone>/start?callback=<callbackFunction><otherCallSetupParams>
where:
<contactId> identifies the call template that contains call setup instructions. Refer to the Call Templates section of this document for more information about call templates.
<userPhone> contains the user’s telephone number in E.164 format.
<callbackFunction> specifies the name of the callback function to which the server-side JSON response should be passed.
<otherCallSetupParams> lists other optional call setup parameters, each one preceded by an ampersand (&).
The optional request parameters that may be passed are:
Parameter Name
Description
delay
Number of seconds to delay the start of the call by. The default value is 0.
userExtension
Indicates the extension that the user can be reached on. DTMF tones will be used to dial the extension number. The only characters permitted are numeric digits (0‐9), period (.), comma (,), asterisk (*) and hash (#), where comma (,) represents a 2 second delay, and period (.) silences audio messages during the auto navigation.
visitorId
Identifies the visitor.
referrerUrl
URL of the page from which the call originated.
language
Two‐digit ISO code identifying the visitor’s language.
<optionalDataFieldName>
Specifies value for the optional data field identified using either its account‐specific label or the internal varN field name. Up to 10 optional data fields can be specified in this way. Refer to Appendix B: Handling Optional Data for further information.
authorizeUrl
Provides a URL that is used to authorize the start call request and to optionally override some attributes of the call.
authEncrypted
Indicates whether the URL passed in the ‘authorizeUrl’ parameter has been encrypted.
Set to true if the URL is encrypted, or false if it is not. The default value is false.
confirmAcceptance
Controls whether the user is prompted to confirm acceptance of the call. Allowable values are ‘true’ and ‘false’. The default value is ‘false’. To turn on call confirmation acceptance, set this to ‘true’.
callAgentFirst
Control whether the call leg ordering is reversed so that the agent is called before the user. Allowable values are ‘true’ and ‘false’. The default value is ‘false’. To turn reverse call flow, set this to ‘true’.
when
Specifies the scheduled start time of the call. The value specified must be a date/time in the future. The format of the scheduled start time should be in RFC 2822 date/time format.
If the Start Call request is successful, then the response body should contain a JavaScript function call with the JSON response, which includes the session ID for the call, embedded in the function call. The name of function is specified in the callback request parameter.
For example, if the callback request parameter contains the name ‘processStartCallResponse’, then the response body is:
processStartCallResponse({"sessionId":"<sessionId>"});
where <sessionId> is the session ID for the new call.
If the Start Call request is unsuccessful, the response body is:
processStartCallResponse({"statuscode":"<statusCode>","reason":"<reason>"});
where <statusCode> contains the HTTP status code (i.e. 400, 403, 404) and <reason> contains the reason for the unsuccessful request.