# Applying API Key in JWT Authentication

**URL:** <https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023>\
**Category:** API and Webhooks\
**Created:** [February 8, 2022, 10:18pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023 "2022-02-08T22:18:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike.hutchinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mike.hutchinson/32/28082_2.png) [@mike.hutchinson](https://devforum.zoom.us/u/mike.hutchinson)\
**Post date:** [February 8, 2022, 10:18pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/1 "2022-02-08T22:18:51Z")

</div>

Still very green with Web Services, Authentication and getting data…

I am running Excel Power Query M language…

= Web.Contents(“[https://mycompany.zoom.us/device](https://mycompany.zoom.us/device)”, [ApiKeyName=“API\_Key”])

see this url… [Web.Contents - PowerQuery M | Microsoft Docs](https://docs.microsoft.com/en-us/powerquery-m/web-contents)  
From M language reference… `ApiKeyName` : **If the target site has a notion of an API key** , this parameter can be used to specify the name (not the value) of the key parameter that must be used in the URL. The actual key value is provided in the credential.

I want to get a list of devices on our account…  
I have registered my app in [marketplace.zoom.us](http://marketplace.zoom.us) and have App credentials.  
any idea if I am on the right track on applying APIKey …or am I even close?

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [February 9, 2022, 6:42pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/2 "2022-02-09T18:42:42Z")

</div>

Hi @mike.hutchinson ,

I responded to you in your Marketplace Apps thread 🙂

> [@Renew App JWT Token Expiration Time doesn't stick?](https://devforum.zoom.us/t/renew-app-jwt-token-expiration-time-doesnt-stick/64001/4):
>
> Hi @mike.hutchinson , I see. So from the docs you shared, I do not know if this will work as intended because in the example 3 you’re referring to it says “Connect to a secure URL that accepts an authentication key as part of its query string”: Our JWT process uses bearer authentication: The token itself is what allows you access to make requests to the Zoom API. Without the token, I do not think you’ll receive the connection you’re…

---

<div class="post-metadata">

**Author:** ![dan.brill](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.brill/32/35196_2.png) [@dan.brill](https://devforum.zoom.us/u/dan.brill)\
**Post date:** [February 16, 2022, 8:46pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/3 "2022-02-16T20:46:23Z")

</div>

Hi Mike,  
I’ve been working on the same thing. We can’t be the only ones, right? Here’s what’s working for me:

```auto
let
    jwtToken = "yourTokenHere",
    endPoint = "https://api.zoom.us/v2/users/your.email@here.com/meetings",
    Source = Json.Document(Web.Contents(endPoint, [Headers=[Authorization="Bearer " & jwtToken, Accept="application/json"]])),
    meetings = Source[meetings],
    convertToTable = Table.FromList(meetings, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    convertToTable

```

Get your jwtToken at the bottom of your JWT App admin page. It’s sort of hidden at the bottom under the IM Chat History Token field.

Hope that helps,  
Dan

---

<div class="post-metadata">

**Author:** ![mike.hutchinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mike.hutchinson/32/28082_2.png) [@mike.hutchinson](https://devforum.zoom.us/u/mike.hutchinson)\
**Post date:** [February 18, 2022, 10:17pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/4 "2022-02-18T22:17:02Z")

</div>

😯

Oh… thank you! I will give this a try!!!

---

<div class="post-metadata">

**Author:** ![mike.hutchinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mike.hutchinson/32/28082_2.png) [@mike.hutchinson](https://devforum.zoom.us/u/mike.hutchinson)\
**Post date:** [February 25, 2022, 3:53pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/5 "2022-02-25T15:53:09Z")

</div>

This looks to have worked to get one of our user’s meetings!!! I am excited! Now trying to understand the syntax and refashion to get info on devices.

Thanks!

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [February 25, 2022, 4:10pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/6 "2022-02-25T16:10:18Z")

</div>

Thank you @dan.brill for your inputs here!

---

<div class="post-metadata">

**Author:** ![cassey.gibson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/cassey.gibson/32/35194_2.png) [@cassey.gibson](https://devforum.zoom.us/u/cassey.gibson)\
**Post date:** [February 25, 2022, 5:42pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/7 "2022-02-25T17:42:39Z")

</div>

Glad that worked. Happy to help when I can. 🙂

Edit: Whoops. Looks like I logged on with the wrong account. It’s me, Dan. 😃

---

<div class="post-metadata">

**Author:** ![mike.hutchinson](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mike.hutchinson/32/28082_2.png) [@mike.hutchinson](https://devforum.zoom.us/u/mike.hutchinson)\
**Post date:** [February 25, 2022, 8:19pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/8 "2022-02-25T20:19:57Z")

</div>

Well shoot. I spoke too soon. In Power Query editor it looks to work. But when I go to load the data into Excel sheet… I get “We couldn’t authenticate with the credentials provided. Please try again”

Wondering what I am missing?

 ![ResultsInPowerQueryEditor](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/c/1/c1841d3f7e2a42123d476e52ffb092d3aaa5a0d4.png)  
 ![ResultsInExcel](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/b/b/bb605a2400a03010b381eee0f60506d2ead67205.png)

---

<div class="post-metadata">

**Author:** ![dan.brill](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dan.brill/32/35196_2.png) [@dan.brill](https://devforum.zoom.us/u/dan.brill)\
**Post date:** [February 27, 2022, 10:18pm UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/9 "2022-02-27T22:18:42Z")

</div>

Hmm. Anonymous is the right type. I have Privacy Level set to None/Ignore as the API key is enough for me. What are you using as the Privacy Level?

If that’s not the issue, could you post the raw code from the advanced editor? I doubt there’s anything to see there since the preview worked in the editor. I’ve never had the preview load but not the output.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [March 30, 2022, 8:19am UTC](https://devforum.zoom.us/t/applying-api-key-in-jwt-authentication/64023/10 "2022-03-30T08:19:22Z")

</div>

Closed on March 30, 2022, 8:19am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
