Hello Zoom Dev Community,
I’m building an integration with Zoom’s OAuth API to access user data, but I keep getting an “Invalid Access Token” error on my requests. I’m following the OAuth 2.0 process as documented, and the token seems valid in terms of structure and expiration time.
Here’s what I’ve tried so far:
- Double-checked that I’m using the correct client ID and client secret.
- Confirmed that the access token is received successfully and is included in the request header as
Authorization: Bearer {access_token}
.
- Verified that the token hasn’t expired before making requests.
- Ensured that the necessary scopes (like
user:read
and meeting:read
) are granted.
Despite all this, each API call returns a 401 error with “Invalid Access Token.” Has anyone experienced a similar issue or have any advice on troubleshooting this?
Thanks for your help!
@benstokes.pk8 do you have a sample code how you are retrieving and using the access token?
Thank you for the quick response! Here’s a sample of the code I’m using to retrieve and utilize the access token:
Step 1: Retrieve the Access Token
import requests
def get_access_token():
url = "https://zoom.us/oauth/token"
headers = {
"Authorization": "Basic [base64_encoded(client_id:client_secret)]",
"Content-Type": "application/x-www-form-urlencoded"
}
payload = {
"grant_type": "authorization_code",
"code": "authorization_code",
"redirect_uri": "your_redirect_uri"
}
response = requests.post(url, headers=headers, data=payload)
return response.json().get("access_token")
Step 2: Make an API Request
def get_user_data(access_token):
url = "https://api.zoom.us/v2/users/me"
headers = {
"Authorization": f"Bearer {access_token}"
}
response = requests.get(url, headers=headers)
return response.json()
After retrieving the access token, I include it in the request header as shown. I also verified the scopes and checked that the token hasn’t expired. Despite these, I still encounter the “Invalid Access Token” error.
Any insights or further recommendations would be greatly appreciated!
Is there anyone who can help me? 