API is not returning all the email conversations in a queue

Continuing the discussion from Get all conversations:

There are 20 awaiting emails in one of my test queue and I am trying to get all the emails using GET /api/v2/routing/queues/{queueId}/conversations

The API is only returning 11 conversations out of 20.

Could you please tell me why its not returning all the emails or should I use other API endpoint?

Thanks

Hello,

I think that this API endpoint (GET /api/v2/routing/queues/{queueId}/conversations) is deprecated.
It is not listed in the Routing API endpoints anymore.

To get conversations waiting in a queue, you can use POST /api/v2/analytics/queues/observations/query (Query for Queue Observations).
This API endpoint is described in more details in the article on Queue Query.

You could use the following body (replacing with your queueId):

{
 "filter": {
  "type": "and",
  "predicates": [
   {
    "type": "dimension",
    "dimension": "queueId",
    "operator": "matches",
    "value": "REPLACE_WITH_YOUR_QUEUE_ID"
   },
   {
    "type": "dimension",
    "dimension": "mediaType",
    "operator": "matches",
    "value": "email"
   }
  ]
 },
 "metrics": [
  "oWaiting"
 ],
 "detailMetrics": [
  "oWaiting"
 ]
}

If this request does not return your 20 conversations, I would suggest to open a ticket with Genesys Cloud Customer Care as we can't access and investigate customer data on the forum.

Regards,

Hi,

Thank you for the response.

This solved my problem, however, POST /api/v2/analytics/queues/observations/query
only returns 100 emails.

Is there any other way to get all the waiting emails in the queue irrespective of count or date interval?

Hello,

I think you would need to use an analytics query for conversation details - POST /api/v2/analytics/conversations/details/query - so it would require to specify an interval.
Note if some filters, like one leveraging queueId, are used in the query, the interval can be up to 31 days (max).
If you have more than 100 results(max page size is 100), you will need to page through the results (pageNumber = 2 then 3 ....).

Something like the following request body should allow to capture conversations which are currently sitting in queue ("desc" is used to get most recent conversations first):

{
 "interval": "2021-09-07T22:00:00.000Z/2021-10-08T22:00:00.000Z",
 "order": "desc",
 "orderBy": "conversationStart",
 "paging": {
  "pageSize": 100,
  "pageNumber": 1
 },
 "segmentFilters": [
  {
   "type": "and",
   "predicates": [
    {
     "type": "dimension",
     "dimension": "purpose",
     "operator": "matches",
     "value": "acd"
    },
    {
     "type": "dimension",
     "dimension": "queueId",
     "operator": "matches",
     "value": "YOUR_QUEUE_ID"
    },
    {
     "type": "dimension",
     "dimension": "segmentType",
     "operator": "matches",
     "value": "interact"
    },
    {
     "type": "dimension",
     "dimension": "segmentEnd",
     "operator": "notExists",
     "value": null
    }
   ]
  }
 ],
 "conversationFilters": [
  {
   "type": "or",
   "predicates": [
    {
     "type": "dimension",
     "dimension": "conversationEnd",
     "operator": "notExists",
     "value": null
    }
   ]
  }
 ]
}

Regards,

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