POST /api/v2/oauth/token returns a 200, but the access token expires in an hour. We’re trying to set up a Jenkins pipeline to deploy Architect config changes via the CX as Code CLI, and we can’t rely on manual token refreshes.
Here’s the curl command we’re using:
curl -X POST https://{{mydomain}}.mygenesys.com/api/v2/oauth/token
-H ‘Content-Type: application/x-www-form-urlencoded’
-d ‘client_id={{id}}&client_secret={{secret}}&grant_type=client_credentials’
The response looks standard:
{
“access_token”: “eyJ…”,
“token_type”: “Bearer”,
“expires_in”: 3600
}
We’ve tried using the refresh_token grant type, but that requires a user context which defeats the purpose of a service account workflow. The documentation mentions long-lived tokens for integrations, but the examples are vague on how to actually request one via the API without a browser-based auth flow.
Is there a specific scope or grant type we’re missing? Or do we need to implement a token refresh loop in the Jenkinsfile? We’ve checked the application settings in Admin, and the client credentials are set up correctly for the platform API.
We’re on US West. Any ideas?