Why is the Genesys Cloud Python SDK throwing 401 Unauthorized instead of silently refreshing the token?
We’ve got a long-running data pipeline that hits /api/v2/analytics/interactions/summary. The initial access token expires after 14 minutes, as expected. The docs state:
“The SDK automatically handles token refresh when using the Client Credentials grant with a refresh token.”
But it’s not happening. The script crashes with a 401 error instead of fetching a new token. Here’s the setup:
- Python 3.9
- Genesys Cloud SDK
30.1.0 - OAuth Client configured for
client_credentialsgrant refresh_tokenincluded in the initial auth response
Code snippet:
config = Configuration()
config.oauth_client_id = client_id
config.oauth_client_secret = client_secret
config.oauth_refresh_token = refresh_token
api_instance = GenesysCloudAnalyticsApi(ApiClient(config))
data = api_instance.post_analytics_interactions_summary(body)
The first call works. Subsequent calls after 14 minutes fail. I’ve checked the network traffic, and no POST to /oauth/token is being made by the SDK. Is there a flag I’m missing, or does the Python SDK actually require manual refresh logic for this grant type? The docs are vague on the implementation details.