Trying to hit /oauth/token with client credentials in Python. Getting 401 back. Here is the . Any ideas?
import requests
url = 'https://api.mypurecloud.com/oauth/token'
payload = {'grant_type': 'client_credentials'}
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
auth = ('client_id', 'client_secret')
r = requests.post(url, data=payload, headers=headers, auth=auth)
print(r.status_code)
The credentials work in Postman. Python fails.