Forums

Zoom API

Hello,

I'm working on having PythonAnywhere fetch information from the Zoom Rest API service to import it to our database. I've pasted the sample code from the Zoomus python document and was able to test it correctly on my local machine. When I upload the code to PythonAnywhere and run the script, it gives me an error token message. The API Secret and Key are set to not expire on my JWT app, so the expiration of the key and secret should not be an issue.

import requests
import json
from zoomus import ZoomClient

API_KEY='???'
API_SECRET='???'
client = ZoomClient(API_KEY, API_SECRET)
user_list_response = client.user.list()
user_list = json.loads(user_list_response.content)
print(user_list_response, user_list)

As I said, when I run this script on my machine, my console shows a 200 response and prints the JSON results. But when I upload the same sample code and run the script, I get the following error message.

<Response [401]> {'code': 124, 'message': 'Invalid access token.'}

Is there something I'm missing in PythonAnywhere?

Are you sure that the key and secret you provide are correct and match what you use on your local machine? We do not do anything to your requests as PythonAnywhere.

Hi, yes, both my local machine and python anywhere have the same secret and key values. It may have something to do with Zoom's API or the Zoom handler. I'll contact them to see if they can help.

Let us know what you learn (in case other users have similar problems)

I was able to get this solved. There is something wrong with using the Zoom handler in PythonAnywhere. I couldn't figure it out so I had to create the functions to generate the jwt token and request the information to zoom. Now my code works.

Great! Glad you got it working.