How to use filter in python analytics api?

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:
api_response = api_instance.post_analytics_conversations_aggregates_query(body)
pprint(api_response)

except ApiException as e:
print("Exception when calling PostAnalyticsConversationsAggregatesQueryRequest->post_analytics_conversations_aggregates_query: %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

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,

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