Description
I wrote python code to get all currently scheduled Meetings. When I tested it on my Laptop it worked fine and I got the list of scheduled Meetings. But after hosting my code on a server I zoom returns {'code': 124, 'message': 'Invalid access token.'}
Error
{'code': 124, 'message': 'Invalid access token.'}
Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT
Which Endpoint/s?
https://api.zoom.us/v2/users/{userId}/meetings?type=upcoming
How To Reproduce (If applicable)
My python Code:
import jwt, requests, json
from time import time
API_Key = 'XXXXXXXXXXXXXXXXXX'
API_SEC = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
def generateToken():
token = jwt.encode(
# Create a payload of the token containing
# API Key & expiration time
{'iss': API_Key, 'exp': (time() + 5000)},
# Secret used to generate token signature
API_SEC,
# Specify the hashing algorithm
algorithm='HS256'
)
return token
def getMeetings():
headers = {'authorization': 'Bearer %s' % generateToken(),
'content-type': 'application/json'}
r = requests.get(
f'https://api.zoom.us/v2/users/{userId}/meetings?type=upcoming',
headers=headers)
y = json.loads(r.text)
return y