Anyone know why the get_conversations_details_query method in the Genesys Cloud Python SDK returns an empty dataset even though the POST /api/v2/analytics/conversations/details/query endpoint works fine in Postman? I am building a daily analytics export job that writes to S3 using boto3. The script runs at 02:00 SGT to pull transcription topics and sentiment scores for the previous day.
The issue seems to be related to the timeRange parameter or the granularity setting. When I execute the SDK call, I get a valid response object, but the entities array is empty []. I have verified that the access token has the analytics:conversation:view scope. Here is the relevant snippet:
analytics_api = platform_api_client.AnalyticsApi()
query = {
"viewId": "conversations-default",
"timeRange": {
"type": "relative",
"duration": "P1D"
},
"select": ["topic", "sentiment"]
}
try:
response = analytics_api.get_conversations_details_query(query=query)
print(f"Count: {response.entities_count}")
except Exception as e:
print(f"Error: {e}")
Environment details:
- Python 3.9
genesys-cloud-pythonSDK v2.0.1boto3v1.26- Running on AWS Lambda (ap-southeast-1)
The entities_count is always 0. Is there a specific format required for the timeRange in the SDK that differs from the raw API?