Sign in

Welcome.
How can we help?

Call Back Widget (Custom Form)

Topic: , Updated:

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.

__fs_dncs_instance.requestCallback(
    'AVD_ID', 
    Answering_number_id, 
    Country_code, 
    customer_phonenr, 
    'caller_id', 
    { 
    'custom_1xx' : 'xxxxxx', 
    'custom_1yy' : 'yyyyyy' 
    }, 
    call_time,
    success/error handler(ref, data),
    null,
    retries
);

Here is a short description of each parameter:
'AVD_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. This must be a phone number without spaces. Ex '+4420123456'
custom_* - Here you can pass in 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 time the CBW will attempt to make the call if the first call fails. Default is 2, Options: 1-3.

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

__fs_dncs_instance.requestCallback(
    'xxxxxx-xxxx-xxxx-xxxxxx', 
    1, 
    44, 
    phonenr,  
    '+4420123456789',  
    { 
    'custom_111': $name,  
    'custom_112': $email  
    }, 
    null,  
    function(ref, data) { 
    alert(JSON.stringify(data));  
    }, 
    null,
1 );

Callback widget, user manual

Was this article helpful?
1 out of 1 found this helpful

Comments


Not the answer to your question?

Powered by Zendesk