Trying to build an OTel span that traces our OAuth client usage across orgs. First step is just getting a list of all clients and their assigned scopes using the Python SDK (genesyscloud).
The docs for oauth_api are pretty sparse on the client list endpoint. I’ve been hitting GET /api/v2/oauth/clients directly with requests for testing, but I want to stick to the SDK for consistency in the tracing wrapper.
Here’s what I have so far:
from genesyscloud.platform_client import PlatformClient
from genesyscloud.oauth import OAuthApi
config = PlatformClient.create_from_config_file("config.yaml")
api_instance = OAuthApi(config)
try:
# Assuming there's a list method?
result, response, error = api_instance.get_oauth_clients()
if error:
print(f"Error: {error}")
else:
print(result)
except Exception as e:
print(f"SDK Error: {e}")
The get_oauth_clients method doesn’t actually exist in the generated code. I see get_oauth_client_by_id but no list operation. Is this endpoint not exposed in the Python SDK yet? Or am I missing a pagination helper?
If I have to fall back to raw HTTP, what’s the correct bearer token scope needed to read client scopes without admin privileges? I’m getting 403s when using a token with just view:oauth:client.