Building a background worker that pulls Genesys Cloud interaction data and pushes trace spans to Jaeger. The app runs on a headless server with no user interaction. I need to decide between client_credentials and authorization_code grant types for the OAuth flow.
Right now I’m using client_credentials to get a token:
import requests
data = {
'grant_type': 'client_credentials',
'scope': 'analytics:read'
}
r = requests.post('https://api.mypurecloud.com/oauth/token', auth=(client_id, client_secret), data=data)
token = r.json()['access_token']
The token works for the initial fetch. But when I try to correlate spans with specific user interactions, the trace context feels incomplete. Is client_credentials actually limited in scope compared to authorization_code? Or is the issue just how I’m injecting the traceparent header into the subsequent API calls?
I’ve read the docs on grant types but they don’t clearly state the impact on distributed tracing context propagation. If I switch to authorization_code, I’d need to store refresh tokens which adds complexity. Does the grant type affect the ability to read full participant details needed for accurate span attribution?
Testing this in Asia/Manila timezone so rate limits are tight. Any experience with this setup?