Just noticed that our automated pipeline for fetching POST /api/v2/analytics/icm/evaluations transcripts is failing intermittently. The access token expires exactly when the batch size hits ~500 records, causing the remaining requests to throw 401 Unauthorized.
I am using the Python SDK genesyscloud v2.15.0. The auth_api client seems to handle refresh tokens correctly for single requests, but when I loop through a large list of evaluation IDs using analytics_api.get_icm_evaluation, the underlying OAuth flow does not seem to trigger a refresh mid-iteration. The first half of the batch succeeds, then it crashes.
genesyscloud.api_exception.ApiException: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({"WWW-Authenticate": "Bearer realm=\"Genesys Cloud\"", "Content-Type": "application/json"})
HTTP response body: {"errors": [{"code": "invalidToken", "message": "The access token is expired."}]}
Is there a way to manually inject a token refresh hook into the SDK client before each API call, or should I be implementing a retry mechanism with requests library directly? The current set_default_configuration does not appear to support dynamic token validation per request in a tight loop. Running this from Singapore time zone, so maybe there’s a sync issue with the token TTL?