Applying API Key in JWT Authentication

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

I am running Excel Power Query M language…

= Web.Contents(“”, [ApiKeyName=“API_Key”])

see this url… Web.Contents - PowerQuery M | Microsoft Docs
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 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.

Hi @mike.hutchinson ,

I responded to you in your Marketplace Apps thread :slight_smile:

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:

    jwtToken = "yourTokenHere",
    endPoint = "",
    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)

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,

1 Like


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

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.


Thank you @dan.brill for your inputs here!

Glad that worked. Happy to help when I can. :slight_smile:

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

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?

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.

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