Legacy Dev Forum Posts

 View Only

Sign Up

List all conversations waiting in a queue

  • 1.  List all conversations waiting in a queue

    Posted 06-05-2025 19:34

    mikehardie | 2021-06-21 23:43:19 UTC | #1

    We sometimes times get requests to disconnect all interactions in a queue (no we do not encourage it)

    Is it possible to get a CLI function added that will list all the conversation Ids in a queue?

    MIke


    anon11147534 | 2021-06-22 13:23:20 UTC | #2

    Hi Mike,

    The CLI is basically a wrapper around the public API, so we can't add a specific command for that.

    Using the POST /api/v2/analytics/queues/observations/query as follows will list all active conversations for a given queue.

    {
     "filter": {
      "type": "or",
      "predicates": [
       {
        "type": "dimension",
        "dimension": "queueId",
        "operator": "matches",
        "value": "158bd9f9-a07c-4a96-a22d-eca72929e3f9"
       }
      ]
     },
     "metrics": [
      "oInteracting"
     ],
     "detailMetrics": [
      "oInteracting"
     ]
    }

    The CLI command for that endpoint is gc analytics queues observations query create

    JQ can be used to extract the conversationIds from the response body.

    The quick hits repo has some good examples on how to use the CLI combined with JQ for data manipulation.


    mikehardie | 2021-06-22 08:44:18 UTC | #3

    Thanks Ronan, your answer is perfect - and flexible

    Mike


    system | 2021-07-22 08:44:19 UTC | #4

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


    This post was migrated from the old Developer Forum.

    ref: 11271