Pretty good stuff where you also can output all your monitors with uptimelogs directly to PowerBI or equivalent.
Code:
To get UptimeRobot status from PowerBI the following queries can be used:
Example 1 - Simple query
let
body =
Text.ToBinary("api_key=#myAPIKey#&format=json&logs=1"),
Options = [
Headers=[#"Content-type"="application/x-www-form-urlencoded",
#"cache-control"="no-cache"],
Content=body
],
result = Web.Contents(url, Options)
in
result
Example 2 - Query using records
Example 2 - Query using records
let
content= [
#"api_key"="#myAPIKey#",
#"format" = "json",
#"logs" = "1"
],
query =
Text.ToBinary(Uri.BuildQueryString(content)),
Options = [
Headers=[
#"Content-type"="application/x-www-form-urlencoded",
#"cache-control"="no-cache"],
Content=query
],
result = Web.Contents(Url, Options)
in
result
Example 3 - Query using json
let
content = "{
""api_key"":
""#myAPIKey#"",
""format"":
""json"",
""logs"":
""1""
}",
query =
Text.ToBinary(Uri.BuildQueryString(Json.Document(content))),
Options = [
Headers=[
#"Content-type"="application/x-www-form-urlencoded",
#"cache-control"="no-cache"],
Content=query
],
result = Web.Contents(Url, Options)
in
result