Using this template helps us debug your issues more effectively
Description
I am trying to create meetings via Python
- I have created an app, not published on Marketplace
- I have retrieved an authorization code
- I hade made the request to get the access token and refresh token and get an Error
I have already tried:
- create a new authorization code and run the POST request again, same result
Error
b’{“reason”:“Invalid authorization code”,“error”:“invalid_grant”}’
Which App Type (OAuth / Chatbot / JWT / Webhook)?
OAuth.
Which Endpoint/s?
not there yet , but planning to
- view user, and
- create meetings
How To Reproduce (If applicable)
Steps to reproduce the behavior:
1.
https://zoom.us/oauth/authorize?response_type=code&client_id=[Redacted]&redirect_uri=MYURL
2. grab the Authentication code from the response to 1
3. run the POST request
def get_access_token(app_credentials):
"""
Get the access token from Zoom
arguments:
app_credentials -- dic of Zoom app credentials
{'name': MY_APP_NAME,
'clientID': CLIENT_ID,
'client_secret': CLIENT_SECRET,
'verification_token': VERIFICATION_TOKEN,
'redirect_url': REDIRECT_URL,
'code from redirect': CODE_FROM_REDIRECT,
'authorization_code': AUTHORIZATION_CODE
}
returns:
None
"""
url = f"https://zoom.us/oauth/token?grant_type=authorization_code&code={app_credentials.get('code from redirect')}&redirect_uri={app_credentials.get('redirect_url')}"
payload = {}
header_autho = "Basic {}".format(base64.b64encode(bytes("{}:{}".format(app_credentials.get('clientID'), app_credentials.get('client_secret')).encode("utf - 8"))).decode("utf - 8"))
headers = {
'Authorization': header_autho
}
response = requests.request("POST", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
return None
Additional context
I am a user on an enterprise account, and only want to use the app for my own user ID
Forum post I found helpful in getting me this far:
Understanding OAuth for Zoom - API and Webhooks - Zoom Developer Forum