# {'code': 124, 'message': 'Invalid access token.'}

**URL:** https://devforum.zoom.us/t/code-124-message-invalid-access-token/59620
**Category:** API and Webhooks
**Created:** [November 1, 2021, 5:17am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token/59620 "2021-11-01T05:17:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Longvu2000](https://avatars.discourse-cdn.com/v4/letter/l/8491ac/32.png) [@Longvu2000](https://devforum.zoom.us/u/Longvu2000)
#### Post date: [November 1, 2021, 5:17am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token/59620/1 "2021-11-01T05:17:38Z")

</div>

Hi everyone,

I am strugling with the error: {‘code’: 124, ‘message’: ‘Invalid access token.’} while trying to generate Token using the below code:

```auto
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 alg

        algorithm='HS256'

    )

    return token

def createMeeting():
	headers = {'authorization': 'Bearer %s' % generateToken(),
			'content-type': 'application/json'}

	r = requests.post(f'https://api.zoom.us/v2/users/me/meetings',headers=headers, data=json.dumps(meetingdetails))
	print("\n creating zoom meeting ... \n")    
	y = json.loads(r.text)
	print(y)
	join_URL = y["join_url"]
	meetingPassword = y["password"]

	print(
		f'\n here is your zoom meeting link {join_URL} and your \
		password: "{meetingPassword}"\n')

```

---

<div class="post-metadata">

### Author: ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)
#### Post date: [November 2, 2021, 10:40am UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token/59620/2 "2021-11-02T10:40:01Z")

</div>

Hey @Longvu2000,

Have you tried leveraging one of the existing libraries on [https://jwt.io](https://jwt.io)? You can also grab a pre-generated token directly from our Marketplace UI, from within your JWT app.

Thanks,  
Will

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)
#### Post date: [December 2, 2021, 8:40pm UTC](https://devforum.zoom.us/t/code-124-message-invalid-access-token/59620/3 "2021-12-02T20:40:07Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
