davide.graziani | 2023-11-17 15:28:53 UTC | #1
Hello, I'm doing some test to extract conversation data using async mode. In fact I'm trying to use the ConversationsApi.postanalyticsconversationsaggregatesjobs(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
apiresponse = apiinstance.postanalyticsconversationsaggregatesjobs(body) pprint(apiresponse) except ApiException as e: print("Exception when calling ConversationsApi->postanalyticsconversationsaggregates_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
tim.smith | 2023-11-17 15:44:56 UTC | #2
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.
davide.graziani | 2023-11-17 15:54:37 UTC | #3
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..
davide.graziani | 2023-11-17 16:06:19 UTC | #4
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
apiresponse = apiinstance.postanalyticsconversationsaggregatesjobs(body) pprint(apiresponse) except ApiException as e: print("Exception when calling ConversationsApi->postanalyticsconversationsaggregates_jobs: %s\n" % e)
but i got the exception:
Exception when calling ConversationsApi->postanalyticsconversationsaggregatesjobs: (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":[]}
tim.smith | 2023-11-17 16:07:31 UTC | #5
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.
system | 2023-12-18 16:08:07 UTC | #6
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 23191