Hi All,
Good Day!
Getting a bad request for request token after a Authorization Code issue.
General Overview for Proof of Concept
So basically, what the application does, is create a meeting on BEHALF of USER ZOOM account. So, I created an OAuth App and follow this link: OAuth for user authorized apps,
Scenario
it ask permission base on my scope request --working as expected
Once I click Allow it will redirect to my callback url method with Authorization Code–working as
expected
When i try to request an access and refresh token base on the authorization code , I am getting
a bad request.
I had a similar problem when first authenticating. Try adding
'headers.Add(“Host”, “zoom.us”); ’
in the headers dictionary. It’s not included in the chart in the documentation but is in the example.
Alternately, and I only say this because I made this mistake too, are you useing the code within an hour of receiving it?
Hmm, dang I thought that might work. I think I’m using the same version as you. I followed the same documentation, created Oath app to interact with the rest API for meetings and chat. The only difference is that I’m a python developer and my C knowledge is a bit rusty. Any luck when adding the Host parameter in postman?
This may just be a python vs C difference but when sending the request through the request library the body is actually sent with the params argument not the the body. Maybe try switching from Body to Params on postman and see is that works?
Sure thing, Its wrapped in a class to handle some refresh token shenanigans’ so ignore the self’s.
params = {
“code”: self.access_code,
“grant_type”: “authorization_code”,
“redirect_uri”: self.redirect_uri,
}
response = requests.post(
url=url, headers=self.get_authorization_header(), params=params
) # sending the URL with the needed parameters
token = None # initializing a token object
if (
response.ok
): # if the call was successful update the token object, if not raise an error as no other operations can continue
token = response.json()
print(“Received token info”)
self.token = token