Legacy Dev Forum Posts

 View Only

Sign Up

How to use filter in python analytics api?

  • 1.  How to use filter in python analytics api?

    Posted 06-05-2025 19:07

    Hansmuffs | 2022-11-02 13:51:51 UTC | #1

    Hi guys, I use the /api/v2/analytics/conversations/aggregates/query api via python. This is my code:

    api_instance = PureCloudPlatformClientV2.ConversationsApi(apiclient) body = PureCloudPlatformClientV2.ConversationAggregationQuery() # ConversationAggregationQuery | query print("---------------------------------------------------") print("- analytics api body object -") print("---------------------------------------------------")

    try: apiresponse = apiinstance.postanalyticsconversationsaggregatesquery(body) pprint(api_response)

    except ApiException as e: print("Exception when calling PostAnalyticsConversationsAggregatesQueryRequest->postanalyticsconversationsaggregatesquery: %s\n" % e)

    Now, I want to use this interval filter: { "interval": "2022-11-01T00:00:00.000Z/2022-11-02T00:00:00.000Z" }

    But I don't know where to put these piece of code into my code above. Can anyone give me a hint, how to use these filter in genesys python api?

    Thanks


    Jerome.Saint-Marc | 2022-11-02 14:18:59 UTC | #2

    Hello,

    "body" is an object of type ConversationAggregationQuery

    So you can set the interval with: body.interval = '2022-11-01T00:00:00.000Z/2022-11-02T00:00:00.000Z'

    There is a tutorial available, with a sample (available with Go, Javascript and Python), that is related to Querying Queue Historical Statistics.

    Regards,


    system | 2022-12-02 14:14:27 UTC | #3

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