Trying to get the access token using Oauth2 password credentials, also I tried to change the grant_type value by client_credentials still received the same error. Tried code:
import requests
payload = f"grant_type=password_credentials&client_id={CI}&client_secret={CS}&username={UN}&password={PW}"
headers = { 'accept': "application/json", Config: Live }
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
Error:
{"error_description":"grant_type is required","error":"invalid_request"}
Any idea what wrong I am doing?
Additionally, I do have one more field access token
but dont know where I should place.
Update in previous code:
headers = {'Authorization': AccessToken, 'accept': "application/json", Config: Live }
response = requests.request("POST", url, data=payload, headers=headers)