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
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.