# My API\_Key is not 22 characters, so why is the code checking this condition? It is 36 characters!

**URL:** <https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220>\
**Category:** Web\
**Created:** [May 27, 2020, 9:46am UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220 "2020-05-27T09:46:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanderson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tanderson/32/2788_2.png) [@tanderson](https://devforum.zoom.us/u/tanderson)\
**Post date:** [May 27, 2020, 9:46am UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/1 "2020-05-27T09:46:58Z")

</div>

**Description**  
When I try to use the web SDK sample, I get an error in the console.  
`{method: "join", status: false, result: null, errorMessage: "Api key length error, must 22", errorCode: 4003}`

This error is also reported by others (though not the cause).

> [@Invalid parameter - webSDK 1.7.6](https://devforum.zoom.us/t/invalid-parameter-websdk-1-7-6/14070/3):
>
> Hi @tommy, I have the same error. I just cloned [https://github.com/zoom/sample-app-web](https://github.com/zoom/sample-app-web) into my laptop and tried to connect to an ongoing live meeting. I still have a free plan. I have created oAuth/JWT/SDK client apps in zoom. Then provided the SDK clientID and secret in this cloned repository. I cannot join to my meeting. Here is the init() from index.js file under CDN subproject. ZoomMtg.init({ leaveUrl: 'http://www.zoom.us', isSupportAV: true, success: …

There is a hard coded check in zoom-meeting-1.7.8.min.js that asserts the API\_Key is length 22. Maybe some API Keys are that length (22 characters), but all the API Keys on our account have length 36.

So because of Zoom’s bug, we cannot use the SDK unless we edit the file zoom-meeting-1.7.8.min.js.

After enduring Chrome devtool lags due to debugging long minified files, I located the cause (aided by the “must 22” error description logged). This is caused by code that checks API key length like this:

`22!==Object(c.o)(i)?u="Api key length error, must 22"`

This must be fixed. I know that some API keys are 22 length, others are 36. Any other possibilities? I don’t see any spec for API Key length. I edit the file zoom-meeting-1.7.8.min.js to correct this check

`![22,36].includes(Object(c.o)(i))?u="Api key length error, must 22 or 36"`

Now the web SDK code sample works.

**Which version?**  
Web SDK 1.7.6, 1.7.7, 1.7.8

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

1. Run the Web SDK with a 36 length API\_key

---

<div class="post-metadata">

**Author:** ![tanderson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tanderson/32/2788_2.png) [@tanderson](https://devforum.zoom.us/u/tanderson)\
**Post date:** [May 27, 2020, 9:50am UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/2 "2020-05-27T09:50:33Z")

</div>

I also created a pull request on GitHub for this bug.

> <https://github.com/zoom/websdk/pull/6>

---

<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:** [June 2, 2020, 6:38pm UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/3 "2020-06-02T18:38:54Z")

</div>

Hey @tanderson,

Make sure you are using a [JWT App](https://marketplace.zoom.us/docs/guides/build/jwt-app) to get your API Key.

The SDK App Key won’t work and is longer than 22 characters.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![tanderson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tanderson/32/2788_2.png) [@tanderson](https://devforum.zoom.us/u/tanderson)\
**Post date:** [June 3, 2020, 1:02am UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/4 "2020-06-03T01:02:47Z")

</div>

I did use the JWT API key. I also changed that 22 to 36 and got the Web SDK to work. It connects just fine when the bad assumption is fixed. Didn’t they tell you that they give out JWT API keys that are 36 characters in length?

@tommy How can I show you that our API keys are all 36 characters in length?

The JWT App key provided to us by Zoom is 36 characters in length.  
The SDK Key provided to us by Zoom is also 36 characters in length.  
We have an old OAuth key that’s 22 characters in length.

The Zoom Web API works just fine when you change that bad code to remove the requirement that it’s 22 characters in length.

This is a screenshot of our JWT key where I have obscured 1/10 of all characters and the final 5 characters. There are definitely 36 characters in the JWT Key you gave me.

![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/2/2a858dca7975a56994948919e1f4235386d9ac50.png)

This is a screenshot when in the meeting. Look, it works with a 36 character JWT API Key!

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/f/f52fe1f157f5a79a748c16b25fd0ab7cdeda3b25.jpeg)

---

<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:** [June 8, 2020, 8:04pm UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/5 "2020-06-08T20:04:39Z")

</div>

Hey @tanderson,

Thanks for sharing these details. (CS-1928)

Can you provide the account # of the owner of the JWT App?

-Tommy

---

<div class="post-metadata">

**Author:** ![tanderson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tanderson/32/2788_2.png) [@tanderson](https://devforum.zoom.us/u/tanderson)\
**Post date:** [June 18, 2020, 7:00am UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/6 "2020-06-18T07:00:19Z")

</div>

@tommy  
Assuming that the account number is not privileged info.

---

<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:** [June 19, 2020, 10:26pm UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/7 "2020-06-19T22:26:01Z")

</div>

Thanks @tanderson, I will keep you updated on a resolution! 🙂

-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:** [June 22, 2020, 4:27pm UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/8 "2020-06-22T16:27:24Z")

</div>

Hey @tanderson,

We have confirmed this to be an issue on our end. We are working to fix the Web SDK logic to allow longer JWT API Keys.

Thanks,  
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, 10:22pm UTC](https://devforum.zoom.us/t/my-api-key-is-not-22-characters-so-why-is-the-code-checking-this-condition-it-is-36-characters/19220/9 "2020-08-21T22:22:43Z")

</div>

Closed on August 21, 2020, 10:22pm UTC


