Problem: Trying to grab an 2 token using the requests library instead of the SDK for a quick script. The auth endpoint keeps rejecting the payload. Maybe the URL is wrong?
Code:
import requests
url = "https://api.mypurecloud.com//token"
data = { "grant_type": "client_credentials", "client_id": "my-id", "client_secret": "my-secret" }
response = requests.post(url, data=data)
Error: 400 Bad Request. Response body says invalid_grant.
Question: Checking if the payload format is wrong or just missing a header for the client credentials grant. The docs don’t mention headers.