Legacy Dev Forum Posts

 View Only

Sign Up

Grouping by externalTag not working in /api/v2/analytics/conversations/aggregates/query

  • 1.  Grouping by externalTag not working in /api/v2/analytics/conversations/aggregates/query

    Posted 06-05-2025 18:33

    kristofferph | 2024-12-17 12:33:51 UTC | #1

    Hi,

    I’m encountering an issue when trying to group metrics by `externalTag` using the `/api/v2/analytics/conversations/aggregates/query` endpoint.

    Request Details:

    Here’s the request body I’m using:

    {
      "interval": "2024-12-17T00:00:00.000Z/2024-12-17T23:59:59.999Z",
      "groupBy": [
        "queueId",
        "mediaType",
        "externalTag"
      ],
      "metrics": [
        "nOffered",
        "tAbandon",
        "tAnswered",
        "tConnected",
        "nConnected",
        "nTransferred",
        "tHandle",
        "tFlowOut",
        "tAcd",
        "tWait",
        "tHeldComplete",
        "tTalkComplete",
        "tAcw",
        "tIVR",
        "tTalk"
      ],
      "granularity": "PT1H"
    }

    What I’ve Done:

    1. I used the `PUT /api/v2/conversations/{conversationId}/tags` endpoint to set the `externalTag` value on specific conversations:
        1. Some conversations have `externalTag = "TEST GROUP 1"`
        1. Others have `externalTag = "TEST GROUP 2"`
    2. I verified via `GET /api/v2/conversations/{conversationId}` that the `externalTag` is correctly set on these conversations.
    3. I ran the aggregate query for the correct interval covering the conversations.

    The Problem:

    When I execute the aggregate query, I don’t see any groups based on the `externalTag`. The response groups by `mediaType` and `queueId`, but the `externalTag` group is missing.

    Any insights or tips would be greatly apprecited.


    system | 2025-01-16 12:29:04 UTC | #2

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