cancel
Showing results for 
Search instead for 
Did you mean: 
Important updates from Zoom Support:
  • Starting February 3, 2025, Zoom Phone customers must add their phone numbers to an approved 10DLC campaign in order to use SMS/MMS capabilities on their numbers.

  • Introducing more live support options! More Zoom customers now have access to live agent chat support. Sign in and visit our Contact Support page to see all your available support options. We’re here to help!

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

aneesraza
Newcomer
Newcomer
@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

Ray_Harwood
Community Champion | Customer
Community Champion | Customer

Welcome to the Zoom Community, @aneesraza 

 

This is a question more appropriate for the Developers Forum at https://developers.zoom.us/


Ray -- check out the GoodClix website or the Z-SPAN website.