# How to request my JWT token?!

**URL:** <https://devforum.zoom.us/t/how-to-request-my-jwt-token/24408>\
**Category:** API and Webhooks\
**Created:** [July 17, 2020, 9:49am UTC](https://devforum.zoom.us/t/how-to-request-my-jwt-token/24408 "2020-07-17T09:49:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![grgbishal360](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@grgbishal360](https://devforum.zoom.us/u/grgbishal360)\
**Post date:** [July 17, 2020, 9:49am UTC](https://devforum.zoom.us/t/how-to-request-my-jwt-token/24408/1 "2020-07-17T09:49:11Z")

</div>

**Description**  
So, I need a JWT token to use zoom api! But how to do request that JWT token using javascript code!

**Error**  
So currently I have a JWT token on my account which I can see in the App Credentials section! But that token changes every 90 minutes! So I need to be able to access the current JWT token so I can use api using javascript code! How do I request that?! I am able to access api’s on POSTMAN because I just copy paste the JWT token from the app credentials section! This is a static way of doing it but on production I need to be able to do it dynamically!

---

<div class="post-metadata">

**Author:** ![vinay](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vinay/32/11954_2.png) [@vinay](https://devforum.zoom.us/u/vinay)\
**Post date:** [July 17, 2020, 12:06pm UTC](https://devforum.zoom.us/t/how-to-request-my-jwt-token/24408/2 "2020-07-17T12:06:54Z")

</div>

The best way is to use a [JWT library](https://jwt.io). You don’t request JWTs, you generate your own using the key & secret.

In Ruby & rails, for instance, you can do this:

```auto
def make_jwt(key, secret):
    token = {
      "appKey": key,
      "iat": Time.now.to_i,
      "exp": 24.hours.from_now.to_i,
      "tokenExp": 1.week.from_now.to_i
    }
    return JWT.encode(token, secret)

```

[Here’s the relevant Zoom documentation](https://marketplace.zoom.us/docs/guides/auth/jwt).

---

<div class="post-metadata">

**Author:** ![grgbishal360](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@grgbishal360](https://devforum.zoom.us/u/grgbishal360)\
**Post date:** [July 18, 2020, 12:26pm UTC](https://devforum.zoom.us/t/how-to-request-my-jwt-token/24408/3 "2020-07-18T12:26:52Z")

</div>

Can you guide me step by step on how to create jwt token?! I couldn’t understand anything form the documentation! I’m so lost! I’m using codeigniter so I’ll be using normal javascript to create token!

---

<div class="post-metadata">

**Author:** ![vinay](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vinay/32/11954_2.png) [@vinay](https://devforum.zoom.us/u/vinay)\
**Post date:** [July 20, 2020, 2:20pm UTC](https://devforum.zoom.us/t/how-to-request-my-jwt-token/24408/4 "2020-07-20T14:20:06Z")

</div>

Using [node-jsonwebtoken](https://github.com/auth0/node-jsonwebtoken):

```auto
var jwt = require('jsonwebtoken');
var token = jwt.sign({ "appKey": APP_KEY }, APP_SECRET, { expiresIn: '7d' });

```

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [July 22, 2020, 10:41pm UTC](https://devforum.zoom.us/t/how-to-request-my-jwt-token/24408/5 "2020-07-22T22:41:45Z")

</div>

Hey @grgbishal360,

Were you able to generate your JWT Token?

Thanks @vinay for your solutions! 🙂

Thanks,  
Tommy
