Post_analytics_conversations_aggregates_jobs

Hello,
I'm doing some test to extract conversation data using async mode.
In fact I'm trying to use the ConversationsApi.post_analytics_conversations_aggregates_jobs(body)

In the documentation I can see "body" is defined:

`api_instance = PureCloudPlatformClientV2.ConversationsApi(apiclient);
body = PureCloudPlatformClientV2.ConversationAsyncAggregationQuery() # ConversationAsyncAggregationQuery | query

try:
# Query for conversation aggregates asynchronously
api_response = api_instance.post_analytics_conversations_aggregates_jobs(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ConversationsApi->post_analytics_conversations_aggregates_jobs: %s\n" % e)

`

But honestly isn't very clear for me how to setup the filter, for instance an interval dates.

Please someone can help me to understand how i can do it?

Thanks!
davide

Hello, you can find documentation on the conversation aggregate query here: https://developer.genesys.cloud/analyticsdatamanagement/analytics/aggregate/conversation-query. You can use API Explorer to guide you in creating the request: POST /api/v2/analytics/conversations/aggregates/query. Once you have the query working the way you want it in API Explorer, then copy it into your app.

Yes I did, but in the Python code, for me at least, it's not clear how to setup the query I have :slight_smile:
body = PureCloudPlatformClientV2.ConversationAsyncAggregationQuery() # ConversationAsyncAggregationQuery | query

So I'm still have doubts how to add the filter for interval dates..

I setup body like:
body = {'interval':'2023-09-24T00:00:00/2023-09-25T00:00:00'}

and then just copied and pasted the code from api explorer

try:
# Query for conversation aggregates asynchronously
api_response = api_instance.post_analytics_conversations_aggregates_jobs(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling ConversationsApi->post_analytics_conversations_aggregates_jobs: %s\n" % e)

but i got the exception:

Exception when calling ConversationsApi->post_analytics_conversations_aggregates_jobs: (501)
Reason: Not Implemented
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Content-Length': '180', 'Connection': 'keep-alive', 'Date': 'Fri, 17 Nov 2023 16:03:56 GMT', 'ININ-Correlation-Id': '3880a776-f2eb-42b4-a090-9a1a46950a74', 'Strict-Transport-Security': 'max-age=600; includeSubDomains', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 90b61e5a30183aa79750071040752402.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'CDG52-P5', 'X-Amz-Cf-Id': 'WrEhid9n49CMj3YEtD48EUlnyLl-vOLGdXUvOOZ-ur7QBAMCrGSLUg=='})
HTTP response body: {"message":"This endpoint is not yet implemented,","code":"feature.toggle.not.implemented","status":501,"contextId":"3880a776-f2eb-42b4-a090-9a1a46950a74","details":[],"errors":[]}

Per the function's documentation here: https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudpython/ConversationsApi#---asyncqueryresponse----asyncqueryresponse-html--post-analytics-conversations-aggregates-jobs-body-, it's a preview resource. Many preview resources are part of closed beta programs. If you're not part of the beta, you'll get that error. You can open a case with Genesys Cloud Care to request access to the beta.

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