Forum

Help with JSON API ...
 
Notifications
Clear all

Help with JSON API setup in Powerquery

2 Posts
2 Users
0 Reactions
264 Views
(@pollepot)
Posts: 1
New Member
Topic starter
 

Hi guys,

Im trying to setup a connection to an API using powerquery, but so far i've been unable to get it right, im trying to make a POST request to a site called detrack.com.

Documentation here

https://www.detrack.com/api-documentation/

Specifically its the "view all" im trying to connect to: https://www.detrack.com/api-documentation/view-all-collections/

I tried following this guide, without much luck though

https://digitalborn.org/post-requests-excel-power-bi/

I hope one of you can help me, it'd be greatly appreciated!

/Martin

 
Posted : 01/06/2019 4:07 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Martin,

You have an example here  using a custom header to pass the api key. (Set Custom HTTP header ‘X-API-KEY‘ with your Detrack API key instead of [Headers=[#"X-Auth-Token"=Token]] from that example.)

If you use this method, pass the json into content:

Source = Json.Document(Web.Contents(URLString,

[Headers=[#"X-API-KEY"=yourapikey,
Accept="application/json"],
Content=Text.ToBinary("{""date"":""2016-02-14""}")])),

But you can use method 1 described in documentation, building the api key into url.

 
Posted : 01/06/2019 3:35 pm
Share: