Legacy Dev Forum Posts

 View Only

Sign Up

Fetching pending interaction details

  • 1.  Fetching pending interaction details

    Posted 06-05-2025 19:21

    bblois | 2021-07-14 15:24:20 UTC | #1

    Hey all,

    Very new here and hoping to find some guidance or knowledge. I've been tasked with scripting out a tool which will disconnect all pending interactions (calls that have not been answered by an agent yet) from our call center queue.

    Through the API course I've been able to disconnect interactions with some Javascript in which I already have the ID of the interaction/conversation handy, but for this specific instance I would need to fetch the IDs of all pending interactions.

    Any help would be appreciated! Thanks!


    anon11147534 | 2021-07-14 16:28:30 UTC | #2

    Hi,

    You can use the POST /api/v2/analytics/queues/observations/query to obtain details of pending interactions.

    The following request can be used. The oWaiting metric will give the details of all interactions waiting in a queue. The predicates section should be filled out with the IDs of all the queues you wish to find the interactions for. GET /api/v2/routing/queues can be used to get a list of all queues in your organization. You could also add filters for certain media types if necessary.

    {
     "filter": {
      "type": "or",
      "predicates": [
       {
        "type": "dimension",
        "dimension": "queueId",
        "operator": "matches",
        "value": "QUEUE_1_GUID"
       },
       {
        "type": "dimension",
        "dimension": "queueId",
        "operator": "matches",
        "value": "QUEUE_2_GUID"
       }
      ]
     },
     "metrics": [
      "oWaiting"
     ],
     "detailMetrics": [
      "oWaiting"
     ]
    }

    The analytics query builder is helpful for building analytics queries.


    bblois | 2021-07-14 18:28:16 UTC | #3

    You sir, are my hero.

    Many thanks!


    system | 2021-08-14 18:28:17 UTC | #4

    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: 11466