|Help Centre

Call Back Widget (Custom Form)

Last updated at

It is now possible to implement the Call Back Widget into your own custom forms. Below you will find an explanation of the JavaScript function you can use for this.

Add this function to the OnClick event for the "Call me" button in your form.

    'custom_1xx' : 'xxxxxx', 
    'custom_1yy' : 'yyyyyy' 
    success/error handler(ref, data),

Here is a short description of each parameter:
'ADV_ID' - This is the UUID of the Freespee account
Answering_number_id - This is the ID of the answering number you entered in the Dashboard
Country_code - This is the default country code used
customer_phonenr - This is where you pass in the phone number of the user
'caller_id' - Here you pass in which Caller ID should be used by the CBW. It must be a phone number without spaces. Ex '+4420123456'
custom_* - Here you can pass in the custom info you would like to save regarding the user. These fields will be visible in your CSV reports over calls. Please note, you will need to contact support before using custom fields.
call_time - Here you can pass in null for a direct callback or a UTC Unix Epoch Timestamp in seconds for a scheduled call in the future. If call_time is an integer lower than 10'000'000, it is interpreted as a relative timestamp from now. For example, 600 is interpreted as that the call should be scheduled in 10 minutes from now.
success/error handler(ref, data) - function for handling the response from Freespee
null - Used with ref - Function for use together with the previous one if needed. If not needed, leave as null
retries - Used to specify the number of times the CBW will attempt to make the call if the first call fails. Default is 2, Options: 0-3.

Here is an example of how the function could be implemented, using a form that asks for the user's phone number, name and email address:

    'custom_111': $name,  
    'custom_112': $email  
    function(ref, data) { 
1 );

Example responses:

{"status": "ok", "call_uuid": "123e4567-e89b-12d3-a456-426655440000"}
 {"status": "fail", "phonenr": "Parameter phonenr is invalid"}
 {"status": "fail", "time": "\"time\" must not be in the past"}

Callback widget, user manual

Did you find this article helpful?

Gold StarGreen LightYellow LightRed Light

Powered by Customer Thermometer

If you still need help you can ask our Support team