JWT auth error with generated API code

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

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 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.

Hey @lweber.bt_dev,

We believe this is related to:

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

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.

1 Like

Happy to help!

Glad to hear you got it working! :slight_smile:

Thanks,
Tommy

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 is available on npm and can be used to automatically handle OAuth and easily call Zoom APIs like Meetings, Phone, Users, Team Chat, Chatbot, Accounts, Video SDK, and more. It even includes a Webhook server to easily receive Zoom Webhooks.

npm install @zoom/rivet

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

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:

Docs:

Sample App:

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

Best,
Tommy