How to request my JWT token?!

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

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!

The best way is to use a JWT library. You don’t request JWTs, you generate your own using the key & secret.

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

def make_jwt(key, secret):
    token = {
      "appKey": key,
      "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.

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!

Using node-jsonwebtoken:

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

Hey @grgbishal360,

Were you able to generate your JWT Token?

Thanks @vinay for your solutions! :slight_smile: