# Test API call, using JWT, results in a 124 error code

**URL:** <https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413>\
**Category:** API and Webhooks\
**Created:** [May 6, 2020, 2:39pm UTC](https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413 "2020-05-06T14:39:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![freeholdsoftware](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@freeholdsoftware](https://devforum.zoom.us/u/freeholdsoftware)\
**Post date:** [May 6, 2020, 2:39pm UTC](https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413/1 "2020-05-06T14:39:45Z")

</div>

**Description**  
When I attempt to make an API call, using a JWT token, I’m receiving a response of {“code”:124,“message”:“Invalid access token.”}

I’ve attempted to generate a token using the node library jsonwebtoken and also generating a token from the JWT app tool credentials screen.

I’ve tried both JS code that makes a request and also just a straight curl call as well. I get the same response from the server.

**Error**  
From Curl: {“code”:124,“message”:“Invalid access token.”}  
From JS Code:

> response:  
> IncomingMessage {  
> \_readableState:  
> ReadableState {  
> objectMode: false,  
> highWaterMark: 16384,  
> buffer: BufferList { head: null, tail: null, length: 0 },  
> length: 0,  
> pipes: null,  
> pipesCount: 0,  
> flowing: true,  
> ended: true,  
> endEmitted: true,  
> reading: false,  
> sync: true,  
> needReadable: false,  
> emittedReadable: false,  
> readableListening: false,  
> resumeScheduled: false,  
> paused: false,  
> emitClose: true,  
> autoDestroy: false,  
> destroyed: false,  
> defaultEncoding: ‘utf8’,  
> awaitDrain: 0,  
> readingMore: true,  
> decoder: null,  
> encoding: null },  
> readable: false,  
> \_events:  
> [Object: null prototype] {  
> end: [Array],  
> close: [Array],  
> data: [Function],  
> error: [Function] },  
> \_eventsCount: 4,  
> \_maxListeners: undefined,  
> socket:  
> TLSSocket {  
> \_tlsOptions: [Object],  
> \_secureEstablished: true,  
> \_securePending: false,  
> \_newSessionPending: false,  
> \_controlReleased: true,  
> \_SNICallback: null,  
> servername: ‘[api.zoom.us](http://api.zoom.us)’,  
> alpnProtocol: false,  
> authorized: true,  
> authorizationError: null,  
> encrypted: true,  
> \_events: [Object],  
> \_eventsCount: 8,  
> connecting: false,  
> \_hadError: false,  
> \_handle: null,  
> \_parent: null,  
> \_host: ‘[api.zoom.us](http://api.zoom.us)’,  
> \_readableState: [ReadableState],  
> readable: false,  
> \_maxListeners: undefined,  
> \_writableState: [WritableState],  
> writable: false,  
> allowHalfOpen: false,  
> \_sockname: null,  
> \_pendingData: null,  
> \_pendingEncoding: ‘’,  
> server: undefined,  
> \_server: null,  
> ssl: null,  
> \_requestCert: true,  
> \_rejectUnauthorized: true,  
> parser: null,  
> \_httpMessage: [ClientRequest],  
> write: [Function: writeAfterFIN],  
> [Symbol(res)]: [TLSWrap],  
> [Symbol(asyncId)]: 8,  
> [Symbol(lastWriteQueueSize)]: 0,  
> [Symbol(timeout)]: null,  
> [Symbol(kBytesRead)]: 926,  
> [Symbol(kBytesWritten)]: 379,  
> [Symbol(connect-options)]: [Object] },  
> connection:  
> TLSSocket {  
> \_tlsOptions: [Object],  
> \_secureEstablished: true,  
> \_securePending: false,  
> \_newSessionPending: false,  
> \_controlReleased: true,  
> \_SNICallback: null,  
> servername: ‘[api.zoom.us](http://api.zoom.us)’,  
> alpnProtocol: false,  
> authorized: true,  
> authorizationError: null,  
> encrypted: true,  
> \_events: [Object],  
> \_eventsCount: 8,  
> connecting: false,  
> \_hadError: false,  
> \_handle: null,  
> \_parent: null,  
> \_host: ‘[api.zoom.us](http://api.zoom.us)’,  
> \_readableState: [ReadableState],  
> readable: false,  
> \_maxListeners: undefined,  
> \_writableState: [WritableState],  
> writable: false,  
> allowHalfOpen: false,  
> \_sockname: null,  
> \_pendingData: null,  
> \_pendingEncoding: ‘’,  
> server: undefined,  
> \_server: null,  
> ssl: null,  
> \_requestCert: true,  
> \_rejectUnauthorized: true,  
> parser: null,  
> \_httpMessage: [ClientRequest],  
> write: [Function: writeAfterFIN],  
> [Symbol(res)]: [TLSWrap],  
> [Symbol(asyncId)]: 8,  
> [Symbol(lastWriteQueueSize)]: 0,  
> [Symbol(timeout)]: null,  
> [Symbol(kBytesRead)]: 926,  
> [Symbol(kBytesWritten)]: 379,  
> [Symbol(connect-options)]: [Object] },  
> httpVersionMajor: 1,  
> httpVersionMinor: 1,  
> httpVersion: ‘1.1’,  
> complete: true,  
> headers:  
> { date: ‘Wed, 06 May 2020 14:28:33 GMT’,  
> ‘content-type’: ‘application/json;charset=UTF-8’,  
> ‘transfer-encoding’: ‘chunked’,  
> connection: ‘close’,  
> server: ‘ZOOM’,  
> ‘x-zm-trackingid’: ‘WEB\_7f072285283cc8416baec81814313cf7’,  
> ‘x-content-type-options’: ‘nosniff’,  
> ‘cache-control’: ‘no-cache, no-store, must-revalidate, no-transform’,  
> pragma: ‘no-cache’,  
> expires: ‘Thu, 01 Jan 1970 00:00:00 GMT’,  
> ‘set-cookie’: [Array] },  
> rawHeaders:  
> [ ‘Date’,  
> ‘Wed, 06 May 2020 14:28:33 GMT’,  
> ‘Content-Type’,  
> ‘application/json;charset=UTF-8’,  
> ‘Transfer-Encoding’,  
> ‘chunked’,  
> ‘Connection’,  
> ‘close’,  
> ‘Server’,  
> ‘ZOOM’,  
> ‘x-zm-trackingid’,  
> ‘WEB\_7f072285283cc8416baec81814313cf7’,  
> ‘X-Content-Type-Options’,  
> ‘nosniff’,  
> ‘Cache-Control’,  
> ‘no-cache, no-store, must-revalidate, no-transform’,  
> ‘Pragma’,  
> ‘no-cache’,  
> ‘Expires’,  
> ‘Thu, 01 Jan 1970 00:00:00 GMT’,  
> ‘Set-Cookie’,  
> ‘zm\_aid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly’,  
> ‘Set-Cookie’,  
> ‘zm\_haid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly’,  
> ‘Set-Cookie’,  
> ‘\_zm\_ctaid=2i0HBZuNSkOObk3zaqbFPw.1588775313389.e7e7421dcba4a68b572b6a9b60548d79; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Wed, 06-May-2020 16:28:33 GMT; Path=/; Secure; HttpOnly’,  
> ‘Set-Cookie’,  
> ‘\_zm\_chtaid=357; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Wed, 06-May-2020 16:28:33 GMT; Path=/; Secure; HttpOnly’ ],  
> trailers: {},  
> rawTrailers: ,  
> aborted: false,  
> upgrade: false,  
> url: ‘’,  
> method: null,  
> statusCode: 401,  
> statusMessage: ‘’,  
> client:  
> TLSSocket {  
> \_tlsOptions: [Object],  
> \_secureEstablished: true,  
> \_securePending: false,  
> \_newSessionPending: false,  
> \_controlReleased: true,  
> \_SNICallback: null,  
> servername: ‘[api.zoom.us](http://api.zoom.us)’,  
> alpnProtocol: false,  
> authorized: true,  
> authorizationError: null,  
> encrypted: true,  
> \_events: [Object],  
> \_eventsCount: 8,  
> connecting: false,  
> \_hadError: false,  
> \_handle: null,  
> \_parent: null,  
> \_host: ‘[api.zoom.us](http://api.zoom.us)’,  
> \_readableState: [ReadableState],  
> readable: false,  
> \_maxListeners: undefined,  
> \_writableState: [WritableState],  
> writable: false,  
> allowHalfOpen: false,  
> \_sockname: null,  
> \_pendingData: null,  
> \_pendingEncoding: ‘’,  
> server: undefined,  
> \_server: null,  
> ssl: null,  
> \_requestCert: true,  
> \_rejectUnauthorized: true,  
> parser: null,  
> \_httpMessage: [ClientRequest],  
> write: [Function: writeAfterFIN],  
> [Symbol(res)]: [TLSWrap],  
> [Symbol(asyncId)]: 8,  
> [Symbol(lastWriteQueueSize)]: 0,  
> [Symbol(timeout)]: null,  
> [Symbol(kBytesRead)]: 926,  
> [Symbol(kBytesWritten)]: 379,  
> [Symbol(connect-options)]: [Object] },  
> \_consuming: false,  
> \_dumped: false,  
> req:  
> ClientRequest {  
> \_events: [Object],  
> \_eventsCount: 5,  
> \_maxListeners: undefined,  
> output: ,  
> outputEncodings: ,  
> outputCallbacks: ,  
> outputSize: 0,  
> writable: true,  
> \_last: true,  
> chunkedEncoding: false,  
> shouldKeepAlive: false,  
> useChunkedEncodingByDefault: false,  
> sendDate: false,  
> \_removedConnection: false,  
> \_removedContLen: false,  
> \_removedTE: false,  
> \_contentLength: 0,  
> \_hasBody: true,  
> \_trailer: ‘’,  
> finished: true,  
> \_headerSent: true,  
> socket: [TLSSocket],  
> connection: [TLSSocket],  
> \_header:  
> ‘GET /v2/users/me/meetings?status=active HTTP/1.1\r\nUser-Agent: Zoom-api-Jwt-Request\r\ncontent-type: application/json\r\nhost: [api.zoom.us](http://api.zoom.us)\r\nauthorization: Bearer MYTOKEN\r\naccept: application/json\r\nConnection: close\r\n\r\n’,  
> \_onPendingData: [Function: noopPendingOutput],  
> agent: [Agent],  
> socketPath: undefined,  
> timeout: undefined,  
> method: ‘GET’,  
> path: ‘/v2/users/me/meetings?status=active’,  
> \_ended: true,  
> res: [Circular],  
> aborted: undefined,  
> timeoutCb: null,  
> upgradeOrConnect: false,  
> parser: null,  
> maxHeadersCount: null,  
> [Symbol(isCorked)]: false,  
> [Symbol(outHeadersKey)]: [Object] },  
> request:  
> Request {  
> \_events: [Object],  
> \_eventsCount: 5,  
> \_maxListeners: undefined,  
> uri: [Url],  
> headers: [Object],  
> readable: true,  
> writable: true,  
> \_qs: [Querystring],  
> \_auth: [Auth],  
> \_oauth: [OAuth],  
> \_multipart: [Multipart],  
> \_redirect: [Redirect],  
> \_tunnel: [Tunnel],  
> \_rp\_resolve: [Function],  
> \_rp\_reject: [Function],  
> \_rp\_promise: [Promise],  
> \_rp\_callbackOrig: undefined,  
> callback: [Function],  
> \_rp\_options: [Object],  
> setHeader: [Function],  
> hasHeader: [Function],  
> getHeader: [Function],  
> removeHeader: [Function],  
> method: ‘GET’,  
> localAddress: undefined,  
> pool: {},  
> dests: ,  
> \_\_isRequestRequest: true,  
> \_callback: [Function: RP$callback],  
> proxy: null,  
> tunnel: true,  
> setHost: true,  
> originalCookieHeader: undefined,  
> \_disableCookies: true,  
> \_jar: undefined,  
> port: 443,  
> host: ‘[api.zoom.us](http://api.zoom.us)’,  
> url: [Url],  
> path: ‘/v2/users/me/meetings?status=active’,  
> \_json: true,  
> httpModule: [Object],  
> agentClass: [Function],  
> agent: [Agent],  
> \_started: true,  
> href: ‘[https://api.zoom.us/v2/users/me/meetings?status=active](https://api.zoom.us/v2/users/me/meetings?status=active)’,  
> req: [ClientRequest],  
> ntick: true,  
> response: [Circular],  
> originalHost: ‘[api.zoom.us](http://api.zoom.us)’,  
> originalHostHeaderName: ‘host’,  
> responseContent: [Circular],  
> \_destdata: true,  
> \_ended: true,  
> \_callbackCalled: true },  
> toJSON: [Function: responseToJSON],  
> caseless: Caseless { dict: [Object] },  
> body: { code: 124, message: ‘Invalid access token.’ } } }

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
JWT

**Which Endpoint/s?**  
Curl Call: [https://api.zoom.us/v2/users?status=active&page\_size=30&page\_number=1](https://api.zoom.us/v2/users?status=active&page_size=30&page_number=1)  
JS Code: [https://api.zoom.us/v2/users/me/meetings](https://api.zoom.us/v2/users/me/meetings)

**How To Reproduce (If applicable)**  
Steps for The Curl Call:

1. The command I’m setting up:  
curl --request GET --url ‘[https://api.zoom.us/v2/users?status=active&page\_size=30&page\_number=1](https://api.zoom.us/v2/users?status=active&page_size=30&page_number=1)’ --header ‘Authorization: Bearer MYTOKEN’ --header ‘content-type: application/json’

2. I go to the JWT app credentials page in the marketplace and generate a new token for 1 week (tried all three time frames)

3. I copy that in place of MYTOKEN and then try and run the curl command in the shell. I get the response above.

**Screenshots (If applicable)**  
For Curl: [Dropbox - 2020-05-06\_09-36-29\_bash.png - Simplify your life](https://www.dropbox.com/s/dwc8nlz045v6msu/2020-05-06_09-36-29_bash.png?dl=0)  
For JS: [Dropbox - 2020-05-06\_09-38-23\_index1.js — zoom-jwt-api.png - Simplify your life](https://www.dropbox.com/s/g3zaxgr7xqgrfub/2020-05-06_09-38-23_index1.js%20%E2%80%94%20zoom-jwt-api.png?dl=0)

---

<div class="post-metadata">

**Author:** ![freeholdsoftware](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@freeholdsoftware](https://devforum.zoom.us/u/freeholdsoftware)\
**Post date:** [May 6, 2020, 4:25pm UTC](https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413/2 "2020-05-06T16:25:07Z")

</div>

To add on to this post. I just created a second account (for my client) and configured his user with a pro account, then went to the marketplace and provisioned a JWT app and generated a token and the curl call succeeded. I’m wondering if it’s an issue with the implementation of my accounts JWT app?

---

<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:** [May 12, 2020, 6:02am UTC](https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413/3 "2020-05-12T06:02:32Z")

</div>

Hey @freeholdsoftware,

Strange! Please try regenerating the JWT Secret for the account that is not working and try again.

Let me know if that fixes it. 🙂

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![freeholdsoftware](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@freeholdsoftware](https://devforum.zoom.us/u/freeholdsoftware)\
**Post date:** [May 15, 2020, 5:13pm UTC](https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413/4 "2020-05-15T17:13:19Z")

</div>

Hi Tommy,

I just tried regenerating my secret, but I get the same 124 response from the service. I established the key set right around/before the 1.7.4 release of the Web SDK, so I’m wondering if this is caught up in the fallout of that change over.

Ultimately though, this isn’t a high priority. My client has their own account and the keys work there, so I no need worry about this issue.

Thanks,  
Pete

---

<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:** [May 20, 2020, 5:43pm UTC](https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413/5 "2020-05-20T17:43:19Z")

</div>

Thanks for the info @freeholdsoftware.

Let me know if you want me to look into your issue further if you need to use your JWT.

-Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 9:26pm UTC](https://devforum.zoom.us/t/test-api-call-using-jwt-results-in-a-124-error-code/16413/6 "2020-08-21T21:26:30Z")

</div>


