# JWT auth error with generated API code

**URL:** <https://devforum.zoom.us/t/jwt-auth-error-with-generated-api-code/6436>\
**Category:** API and Webhooks\
**Created:** [October 28, 2019, 7:13pm UTC](https://devforum.zoom.us/t/jwt-auth-error-with-generated-api-code/6436 "2019-10-28T19:13:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lweber.bt\_dev](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lweber.bt_dev/32/2362_2.png) [@lweber.bt\_dev](https://devforum.zoom.us/u/lweber.bt_dev)\
**Post date:** [October 28, 2019, 7:13pm UTC](https://devforum.zoom.us/t/jwt-auth-error-with-generated-api-code/6436/1 "2019-10-28T19:13:43Z")

</div>

**Description/Error**  
Caused by: com.zoom.v2client.ApiException: {“code”:124,“message”:“Invalid access token.”}  
at com.zoom.v2client.ApiClient.invokeAPI(ApiClient.java:643)  
at com.zoom.v2client.api.MeetingsApi.meetings(MeetingsApi.java:940)

**Which Endpoint/s?**  
[https://api.zoom.us/v2/users/{userId}/meetings](https://api.zoom.us/v2/users/%7BuserId%7D/meetings)

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. Generate the Java API from the Swagger 2.0 file
2. Call the MeetingsApi.meetings(userId, type, 30, 1) method

**Screenshots (If applicable)**

**Additional context**  
I am using JWT token authentication. Using the same token works fine from the Zoom test site at [https://marketplace.zoom.us/docs/api-reference/testing-zoom-apis](https://marketplace.zoom.us/docs/api-reference/testing-zoom-apis) but fails with the error above when used with the generated API code.

At first I wondered if my account had the correct permissions, but if the call works from the Zoom test site then that shouldn’t be the issue I would think.

Note, this endpoint also works fine with the same JWT token when called using the Unirest Java library.

Why is this error happening?  
Thanks.

---

<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:** [October 28, 2019, 9:24pm UTC](https://devforum.zoom.us/t/jwt-auth-error-with-generated-api-code/6436/3 "2019-10-28T21:24:32Z")

</div>

Hey @lweber.bt_dev,

We believe this is related to:

> [@Issues with Swagger client generation for Java](https://devforum.zoom.us/t/issues-with-swagger-client-generation-for-java/6105):
>
> I have noticed two problems with the generated Java client code. At the moment, these require manual changes by me in order to use the client API code. The user ‘pmi’ field is typed as a Java Integer in the InlineResponse20033 model class, but the field is required to have 10-digits. This means that any pmi which represents a number greater than 2147483647 (0x7FFFFFFF) will overflow the Java Integer type, and de-serialization (for example, Jackson libraries) will throw an exception. The ac…

In the meantime, while we are working to fix, I would suggest coding the request and JWT Authentication Bearer manually without the generated code.

JIRA: DEVELOPERS-404

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![lweber.bt\_dev](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/lweber.bt_dev/32/2362_2.png) [@lweber.bt\_dev](https://devforum.zoom.us/u/lweber.bt_dev)\
**Post date:** [October 31, 2019, 9:53pm UTC](https://devforum.zoom.us/t/jwt-auth-error-with-generated-api-code/6436/4 "2019-10-31T21:53:59Z")

</div>

Thanks for the reply, Tommy. I must now admit that I just discovered this one was my fault; as long as I set the JWT token then the call itself succeeds.

---

<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:** [October 31, 2019, 10:12pm UTC](https://devforum.zoom.us/t/jwt-auth-error-with-generated-api-code/6436/5 "2019-10-31T22:12:57Z")

</div>

Happy to help!

Glad to hear you got it working! 🙂

Thanks,  
Tommy

---

<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:** [January 22, 2025, 10:14pm UTC](https://devforum.zoom.us/t/jwt-auth-error-with-generated-api-code/6436/6 "2025-01-22T22:14:49Z")

</div>

Hey everyone,

Recently we launched **Zoom Rivet for Node.js**. Zoom Rivet is **Zoom’s Official API Library and API Wrapper**.

We currently support Node.js. Java, Python, GO, C#, and other languages are coming soon or being considered.

[Zoom Rivet](https://developers.zoom.us/docs/rivet/javascript/get-started/) is available on [npm](https://www.npmjs.com/package/@zoom/rivet) and can be used to automatically handle [OAuth](https://developers.zoom.us/docs/rivet/javascript/authorization/) and easily call [Zoom APIs](https://developers.zoom.us/docs/api/) like [Meetings](https://developers.zoom.us/docs/api/meetings/), [Phone](https://developers.zoom.us/docs/api/phone/), [Users](https://developers.zoom.us/docs/api/users/), [Team Chat](https://developers.zoom.us/docs/api/team-chat/), [Chatbot](https://developers.zoom.us/docs/api/chatbot/), [Accounts](https://developers.zoom.us/docs/api/accounts/), [Video SDK](https://developers.zoom.us/docs/api/video-sdk/), and more. It even includes a Webhook server to easily receive Zoom [Webhooks](https://developers.zoom.us/docs/api/webhooks/).

```auto
npm install @zoom/rivet

```

Example that handles OAuth and calls a Meeting API and listens to a webhook event:

```js
import { MeetingsS2SAuthClient } from "@zoom/rivet/meetings";

(async () => {
   const meetingsClient = new MeetingsS2SAuthClient({
      clientId: process.env.CLIENT_ID,
      clientSecret: process.env.CLIENT_SECRET,
      webhooksSecretToken: process.env.WEBHOOKS_SECRET_TOKEN,
      accountId: process.env.ACCOUNT_ID
   });

   // Rivet Events and Endpoints Go Here

   meetingsClient.endpoints.meetings.getMeeting({
      path: { meetingId: "MEETINGID" }
   }).then((response) => {
      console.log(response)
   });

   meetingsClient.webEventConsumer.event("meeting.started", (response) => {
      console.log(response.payload);
   })

   const server = await meetingsClient.start();

   console.log(`Zoom Rivet Events Server running on: ${JSON.stringify(server.address())}`);
})();

```

NPM:

> **[@zoom/rivet](https://www.npmjs.com/package/@zoom/rivet)**
>
> Zoom Rivet is a comprehensive toolkit built to help developers quickly integrate and manage server-side applications within the Zoom ecosystem. This tool currently supports Node.js, offering core functionalities like authentication, API wrappers, and...

Docs:

> **[Get started - Zoom Developers](https://developers.zoom.us/docs/rivet/javascript/get-started/)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

Sample App:

> **[GitHub - zoom/rivet-javascript-sample: Standup Bot sample app for Zoom Rivet for...](https://github.com/zoom/rivet-javascript-sample)**
>
> Standup Bot sample app for Zoom Rivet for JavaScript

For feedback, requests, or questions please refer to the Rivet Devforum Category:

> **[Zoom Rivet](https://devforum.zoom.us/c/rivet/90)**
>
> Zoom Rivet helps quickly integrate server-side applications with Zoom. Built-in authentication, API wrappers and event subscriptions let you focus on business logic, not infrastructure.

Best,  
Tommy
