Request and Manage Callbacks

Integrate the Request Callback API to allow customers to request a callback instead of waiting on hold.

Telephony providers can integrate theRequest Callback API to allow customers to request a callback instead of waiting on hold. When a rep accepts a contact request, Omni-Channel initiates an automatic outbound call to the phone number in the contact request’sPreferred Phone Number field. If the call fails, the system retries based on the Available Callback Attempts and Delay Between Callback Attempts configured on the contact request.

For example, see this sample on how to call the API from your connector to initiate the process.

1requestCallback(params) {
2        const voiceCallIdParam = params.voiceCallId || voiceCallId;
3        const callbackNumber = params.callbackNumber;
4        const vendorCallKey = params.vendorCallKey;
5        const telephonyProviderName = params.telephonyProviderName || 'demo-connector';
6
7        if (!callbackNumber) {
8            return Promise.reject(new Error('callbackNumber is required'));
9        }
10
11        const fieldValues = { callbackNumber, ...(vendorCallKey && { vendorCallKey }), ...(isPreviewCallback === true && { isPreviewCallback: true }) };
12        const headers = {
13            headers: {
14                'Authorization': `Bearer ${getToken()}`,
15                'Content-Type': 'application/json',
16                'Telephony-Provider-Name': telephonyProviderName
17            }
18        };
19
20        console.log("Field Values for requestCallback: " + JSON.stringify(fieldValues));
21        return voiceCallIdParam ?
22            getAxiosClient(tenantInfo).post(`/voiceCalls/${voiceCallIdParam}/requestCallback`, fieldValues, headers).then((response) => {
23                console.log("Request callback response: " + JSON.stringify(response.data));
24                return response;
25            }) : Promise.reject(new Error('voiceCallId is required for requestCallback'));
26    },