Power Query code question - Please help a noob!

Hi guys,

I’m kinda new to accessing APIs in general and I’m not really a coder. Nevertheless, I feel I must be close with this. Can anyone tell me how to fix my Power Query? It must be something super simple…
API key redacted, of course.
The Power Query editor errors saying “Token Comma Expected” and highlighting the colon after “boards (ids” in the following query:

let
Source = Web.Contents(“https://api.monday.com/v2/”, [Headers=[Authorization=“Bearer myapikey”, #“Method”=“GET”,
#“Content-Type”=“application/json”]]
{
boards (ids:[000000000, 000000000]) {
items {
name
id
column_values{
text
}
}
}
}
),

in
Source

Can anyone please help?

Hello Bravura,

I would advise you to use a developer tool like postman to first test out your API keys and queries.
Postman is free and used by many devs. https://www.getpostman.com/
It’s free just download the app. (I am not related in any way to this product besides using it for a few years)

I included images below of the settings I set so you can just use them and get it working. If you can access your data with the app then you can focus on your code side. If you cant get it to work then you are prob using the wrong API key. I made the same mistake in my first pass. :stuck_out_tongue:

Good luck!
AO

Hi Alex,

I was beginning to think this forum was a ghost town! Thanks for your advice, I will give it a try.

I definitely have the right API key, but it’s the coding half of it I need. I’ll have a crack at Postman tomorrow. Thanks again!

Ben

Besides getting it to work in a test app, the first things that kind of raise flags in your code are.

  1. Using GET instead of POST. (Documentation says POST. Tho I did try with Postman ,and GET did work. )
  2. Missing the proper query structure ,as seen in my postman app image and Monday documentation. (I could be wrong about this one as well for your setup.)

query {
boards(){
}
}

Here is a pic of a working PHP snippet. Good luck!!
AO

Annotation 2020-01-09 123325

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