Forum Discussion
BryanAdept4
9 years agoRegular Visitor
Uptime Robot - Web API - "A web API key can only be specified when a web API key name is provided"
Hi All, I would like to use Power BI to query our Uptime Robot account to gather information It all looked easy enough, but am having similar issues to other posts where I get an error response wh...
TheOnlyBob_2
7 years agoFrequent Visitor
Hi guys,
I was just playing around trying to get this to work today and with a bunch of digging I found the solution.
I created a blank query with the code below and it worked:
let
body = Text.ToBinary("api_key=ENTER-API-KEY-HERE&format=json&logs=1"),
actualUrl = "https://api.uptimerobot.com/v2/getMonitors",
Options = [
Headers=[#"Content-type"="application/x-www-form-urlencoded", #"cache-control"="no-cache"],
Content=body
],
result = Web.Contents(actualUrl, Options)
in
resultThis should give you the basis for any query, just adjust 'body' to put in a different payload.
Credit to these threads for getting me there
https://community.powerbi.com/t5/Desktop/How-to-add-body-into-Web-Contents/td-p/128996