Liezl_Tamunday | 2023-08-08 02:22:50 UTC | #1
Hi All,
Is there an API that we can use to search existing callbacks by phone number/CLI?
Use Case: customer calls the IVR and there is a long wait in the queue, before offering a callback, we need to check if the number/CLI already had a callback scheduled.
TIA
Liezl
Charaf | 2023-08-08 11:08:29 UTC | #2
Hi @Liezl_Tamunday,
In order to retrieve information about scheduled/waiting callbacks, you can use the API endpoint:
POST /api/v2/analytics/conversations/details/query
For testing purposes, I used the Analytics Query Builder and below you will find the JSON body that must be included in the API request:
{
"interval": "2023-08-07T22:00:00.000Z/2023-08-08T22:00:00.000Z",
"order": "asc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 25,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "or",
"clauses": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "callback"
},
{
"type": "dimension",
"dimension": "segmentEnd",
"operator": "notExists",
"value": null
},
{
"type": "dimension",
"dimension": "callbackNumber",
"operator": "matches",
"value": "ANI"
}
]
}
]
}
]
}
Make sure to include these filters:
- mediaType: this filter serves to include callbacks.
- segmentEnd: this filter includes only callbacks that are not ended (still waiting in the queue).
- callbackNumber: customer's ANI.
Feel free to make some tests directly whithin the dev tools. Once you are good, you can create a Data Action to be consumed in your Architect call flows.
Hope that helps!
Charaf
Liezl_Tamunday | 2023-08-22 10:13:33 UTC | #3
Thank you Charaf, this works perfectly!
Charaf | 2023-08-22 11:08:51 UTC | #4
Hi @Liezl_Tamunday,
I am glad that helped :slight_smile: Feel free to mark it as solved.
Charaf
system | 2023-09-22 11:09:45 UTC | #5
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 21369