Having some issues getting my configuration to work…
I’ve been using Pulumi for IaC but need a quick Python script to audit some routing rules. The docs say the SDK handles token refresh, but my script crashes after an hour with 401 Unauthorized.
Here is the init:
from genesyscloud.platformclientv2 import Configuration, ApiClient
config = Configuration()
config.host = 'https://api.mypurecloud.com'
config.access_token = 'my_static_token'
client = ApiClient(configuration=config)
I assumed setting access_token would trigger the internal refresh logic. Instead, it seems to stick to the initial token until it expires. Do I need to implement a custom OAuthClient or is there a flag I’m missing in the Configuration object?
Payload for context:
{
"client_id": "abc123",
"client_secret": "secret456",
"grant_type": "client_credentials"
}
Any hints on forcing the SDK to manage the lifecycle?