Search existing Callback by phone number and not conversation id

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

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

Thank you Charaf, this works perfectly!

1 Like

Hi @Liezl_Tamunday,

I am glad that helped :slight_smile:
Feel free to mark it as solved.

Charaf

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