I’m trying to get a simple auth script working for the CXone API. The goal is to pull some queue stats via the REST endpoint, but I’m stuck on the initial OAuth token request. I’ve got the client ID and secret from the admin console, and the grant type is set to client_credentials.
Here’s the curl command I’m running:
curl -X POST "https://api.nicecxone.com/platform/oauth2/accesstoken" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=MY_CLIENT_ID&client_secret=MY_CLIENT_SECRET"
The response is consistently a 401 Unauthorized. The JSON payload back is just {"error": "invalid_client"}. I’ve double-checked the credentials in the integration settings and they look correct. I even tried URL-encoding the secret just in case there were special characters, but no luck.
Is there a specific scope I need to pass in the body? Or maybe the endpoint URL is different for the EU region? I’m based on the East Coast, so I assume the US endpoint is right. The docs are a bit light on troubleshooting this specific error. Any ideas what I’m missing?