Trying to understand why my Python script keeps getting rejected by the Genesys Cloud auth endpoint.
I am building a standalone extraction utility to pull analytics data into Snowflake. I need to automate the token generation process. I am using the requests library. My code looks like this. I set the client_id and client_secret. I set the grant_type to client_credentials. I am sending the POST request to https://login.mypurecloud.com/oauth/token. The headers include Content-Type: application/x-www-form-urlencoded. The response I get is HTTP 400 Bad Request. The JSON body returns "error": "invalid_grant". I have verified the credentials in the UI. The application exists. The secret is correct. I have tried URL encoding the secret. I have tried double URL encoding. Nothing works. I am not using the Genesys Cloud Python SDK. I want to use raw requests for this specific step. Why is the grant invalid? Is there a specific format for the body that I am missing? The logs show the request payload is correct. But the server rejects it. I am stuck on this step. Any help is appreciated.