Running a daily job to pull api/v2/analytics/users/summary using the genesyscloud Python SDK. The goal is to write the JSON payload directly to S3 using boto3.
The query works fine for small date ranges. When I expand it to 30 days, the SDK hangs for about 4 minutes before dropping a TimeoutError: [Errno 110] Connection timed out. The Genesys docs say long-running queries should be handled via the async endpoint, but the Python SDK wrapper for get_analytics_user_summary doesn’t seem to expose the polling mechanism clearly.
Here’s the chunk that fails:
client = genesyscloud.analytics.AnalyticsApi(configuration)
query = {
"date_from": "2023-10-01T00:00:00.000Z",
"date_to": "2023-10-31T23:59:59.999Z",
"size": 10000
}
# This blocks forever
response = client.get_analytics_user_summary(query_body=query)
# S3 put
s3.put_object(Bucket='my-bucket', Key='analytics.json', Body=json.dumps(response.body))
I tried increasing the Configuration().timeout to 600 seconds, but it still bombs out. Is there a way to force the SDK to use the async job API for these summary requests, or am I stuck writing a custom polling loop against /api/v2/analytics/jobs? Feels like I’m missing a simple flag here.