payload = ‘grant_type=authorization_code&code=<please enter code here>&redirect_uri=<please enter redirect uri here>&client_id=<please enter client id here>&client_secret=<please enter client secret here>’
headers = {
‘content-type’: ‘application/x-www-form-urlencoded’
}
conn.request(“POST”, “/oauth/v1/token”, payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode(“utf-8”))
“Hope this will helps you out. Please mark it as Solution Accepted & Upvote to help other Community member.
Thanks!”