get access token in my app "error": "400 Client Error: Bad Request for url: https://zoom.us/oauth/to

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2023-05-22 03:08 AM - edited 2023-05-22 03:09 AM
@api.get("/oauth/callback", tags=['Integrations'])
async def callback(request: Request):
authorization_code = request.query_params.get('code')
token_url = 'https://zoom.us/oauth/token'
payload = {
'grant_type': 'authorization_code',
'code': authorization_code,
'client_id': CLIENT_ID,
'client_secret': CLIENT_SECRET,
'redirect_uri': REDIRECT_URI
}
try:
response = requests.post(token_url, data=payload)
response.raise_for_status()
access_token = response.json().get('access_token')
print ("Access token: ", access_token)
if access_token:
# Save the access token in your database or perform any other required actions
return {'access_token': access_token}
else:
return {'error': 'Access token not found'}
except requests.exceptions.HTTPError as e:
return {'error': str(e)}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2023-05-22 02:55 PM
Welcome to the Zoom Community, @aneesraza
This is a question more appropriate for the Developers Forum at https://developers.zoom.us/
