Ruby on rails - JWT API access

Hi there,

Hoping someone can help.

We have set up our code like:

and when we run this in the rails console we get:

response.read_body
{"code":124,"message":"Invalid access token."}

When I generate the token from the “Send test request” here: https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinars

and copy paste that token into this part:

request["authorization"] = "Bearer TOKEN"

it works and we get the response we are after. So the problem lies somewhere in the way our Ruby code is generating the token…

Does anyone know how to resolve this or do you need anymore information?

Hope you can help,
Tim

@storypark,

Welcome to the Zoom Developer Support Forum.

Can you please check if you are using the correct credentials for your account within your code? The error {"code":124,"message":"Invalid access token."}, is generally seen when you do not have the correct access token for the account.

For more information, please visit: JWT quickstart.

Thanks,
Ojus

Hi Ojus thanks for the fast response.

I have added the ClientID as the API_KEY and the Client Secret as the API_SECRET and got those both from here:

So as far as I can see, they are the correct credentials…

Cheers,
Tim

Hi @storypark,

Quick question:

Can you please confirm whether the account that you are trying to generate from has developer permissions ?

An admin on your account either needs to grant those permissions or move you to a role that already has them.

Let me know if you have any questions

Thanks!

Thanks Ojus,

I have sent a message to our admin account holder so hopefully she can help.

However, using the test API at the bottom of the screen here: docs/api-reference/zoom-api/webinars/webinars

It has a step where it asks you to log in then it generates the token. The account we log in with is admin…storypark.com, the main account holder is sharon…storypark.com. When we use the test account we log in with admin…storypark.com and the token it gives us works.

Using JWT in our code, there’s no step to log in or provide user details except for the userId we put into the URL…

Perhaps the problem is that we’ve set up the app in the marketplace under admin@story… and the userID from the URL we’re trying to ping at: url = URI(“https://api.zoom.us/v2/users/#{USER_ID}/webinars”) is the owner account which is Sharon’s email…

Do you think the owner account should be the account which creates the app in the marketplace? i.e. admin@… should be the owner and then the USER_ID would be from that.

Thanks for all your help Ojus,

I have now set up an app under Sharon’s account and it’s all working, so that was the problem here.

Seems like it’s all go now! Thanks again.

Hi,

Glad that the issue was resolved