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:
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?
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:
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.
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
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.