Sitephone
ViewController
For the sitephone to work, you need to register a ViewController with the name sitephone
.
Methods
startCall(params)
Method that allows you to request a call to a specified phone number. The params object contains the following properties:
- phone - the phone number to which the call is being made. This field is required.
- captcha_key - captcha key received from the server. The field needs to be filled in only if captcha is enabled in the sitephone settings.
- captcha_value - captcha entered by a visitor. The field needs to be filled in only if captcha is enabled in the sitephone settings.
- group_id - ID of an operators group with which a website visitor should be connected. This field must be filled in if the option "Process call in accordance with the selected group on the widget" is selected in the sitephone settings in the way calls are processed
- delayed_call_time - parameter for making a delayed call. Set in ms number format, UTC.
Events
callcomplete
The event occurs after a call is requested and allows you to find out if the call order was successful.
Event properties callcomplete: an object containing the following fields:
- success -
true
, if a call order happened,false
, if there were errors in the process. - info - object containing text fields
title
andmessage
to display a message to a website visitor.