Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 when applying the API Key.
In the Uptime Robot API page (https://uptimerobot.com/api) it gives the instructions that look very simple.
Specifically I want to use the getMonitors command to gather all info about all the monitors (websites).
I'm obviously missing something, perhaps needing to pass something in the HTTP Headers section in Advanced, does anyone have information that could point me in the right direction?
Below are excerpts from the Uptime Robot API page that may help but I've not been able to get working.
============================================
Uptime Robot has a very easy-to-use API.
Responses are provided as XML, JSON or JSON-P.
It lets you get the details of your monitors, logs, create/edit/delete monitors, alert contacts and maintenance windows.
That's all.
============================================
Authentication
HTTP Basic Access Authentication is used for verifying accounts.
There are 2 types of api_keys for reaching the data:
============================================
Formats
Responses can either be XML or JSON. Just mention the preferred format as:
format=xml or format=json
In order to get a JSON-P response, the requests need to be sent with a parameter named callback like callback=jsonpUptimeRobot and the response will return as:
jsonpUptimeRobot({...});
=======================================================
Methods
This is a Swiss-Army knife type of a method for getting any information on monitors.
By default, it lists all the monitors in a user's account, their friendly names, types (http, keyword, port, etc.), statuses (up, down, etc.) and uptime ratios.
There are optional parameters which lets the getMonitors method to output information on any given monitors rather than all of them.
And also, parameters exist for getting the notification logs (alerts) for each monitor and even which alert contacts were alerted on each notification.
Parameters: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 result
This 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
Hi @BryanAdept4, did you solve this issue? I am having exactly the same one...
Thanks!
Bye,
A.-
Hi @BryanAdept4,
Please check the following similar threads about how to generate a POST request by specifying the Content option.
https://social.msdn.microsoft.com/Forums/en-US/029fed1d-56fe-476a-9d7d-f367c5036b6e/posting-xml-to-a...
https://community.powerbi.com/t5/Integrations-with-Files-and/M-Query-to-use-POST-method-on-a-Web-API...
Thanks,
Lydia Zhang
Hi, I've had a look at those and can't untangle it unfortunately.
Any other options?
I have reached out to Uptime Robot to see if they have anything already in play
Hi @BryanAdept4,
You would need to firstly consult Uptime Robot support about how to invoke their API, then connect to it from Power BI Desktop.
Thanks,
Lydia Zhang
Issuing a different command (getAccountDetails) gets further and shows that Power BI is issueng this as a GET command rather than a POST command.
How do I set the commands as POST rather than GET?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.