How to create a callback on behalf of an outbound campaign?

We would like to do exactly what this user asked on the developer forum:

During an outbound campaign it's possible that a contact doesn't answer the call, and they might phone back later. We need to play a message to the caller that they will be called back, and then we need to programmatically create a callback by first looking up the callers number in the contact list, and then once finding a match, creating the callback for that contact ID in the outbound campaign so that when the agents get prompted to connect, they will get the same script as usual, and see the contacts details as per the contact list entry.

There used to be an API endpoint that catered for this, but it has been deprecated:

/api/v2/outbound/campaigns/{campaignId}/callback/schedule

There is a message to "Please use /conversations/{conversationId}/participants/{participantId}/callbacks instead."

However, this API endpoint creates a callback media for an existing call, and the incoming call that the contact makes is not associated with the outbound campaign, so my question is: How can I use this suggested endpoint to create a callback on the incoming call interaction on behalf of the outbound campaign?

Hello, is there anyone out there?

Hi!

I don't have an answer for you, but a suggestion of something to try:

Have you looked at the data of a resulting conversation where a callback has been created by
POST /api/v2/outbound/campaigns/{campaignId}/callback/schedule? I'm wondering if you can't mimic that by setting the same attributes in the payload of a request to:

POST /api/v2/conversations/callbacks

It will create a separate conversationId, I'm not sure if that's a dealbreaker for you.
Hopefully matching the attributes will give you the same agent-experience as when using the deprecated endpoint.

Hi, became curious so i did a test by executing
POST /api/v2/conversations/callbacks
with this payload:

{
  "data": {
    "campaignId": "YOUR CAMPAIGN ID",
    "contactId": "YOUR CONTACT ID",
    "phoneColumn": "Cell Phone",
    "schedule": "2023-10-04T10:30:00.000Z",
    "contactListId": "YOUR CONTACT LIST ID"
  },
  "queueId": "YOUR QUEUE ID",
  "callbackNumbers": [
    "CUSTOMERS NUMBER"
  ],
  "callbackScheduledTime": "YOUR DESIRED TIME"
}

When I look in the view 'Scheduled Callbacks' of 'Performance Workspace' I can see that 'Campaign' and 'Campaign Division' is populated successfully.

I haven't tried this functionality prior to the API endpoint being deprecated so I don't know what UI behavior should be there; but give it a go and see if it fits your needs :slight_smile:

best of luck!

1 Like

Hakan, you are a legend!

The data object is what was needed to associate a callback with the contact list entry and to the respective outbound campaign.

POST /api/v2/conversations/callbacks

{
   "scriptId": "SCRIPT ID",
   "queueId": "QUEUE ID",
   "callbackUserName": "MOBILE NUMBER",
   "callbackNumbers": ["MOBILE NUMBER"],
   "callbackScheduledTime": "2023-10-04T11:50:00.000Z",
   "data": {
     "scriptId": "SCRIPT ID",
     "dialerContactId": "CONTACT ININ-OUTBOUND-ID",
     "dialerContactListId": "CONTACT LIST ID",
     "dialerCampaignId": "CAMPAIGN ID"
   }
}

Using the above request body, I was able to get the correct script to load when the callback was initiated and the script pulled the correct contacts details from the contact list. Also the reporting will be correct for these interactions because the callback is now associated with the correct campaign.

Thank you so much!

1 Like

glad to hear it worked out!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.