Good Morning,
Sorry if this has been asked before but I have been unable to find a relevant answer. I am using PowerBI to query the PRTG API. This has been simple in terms of getting all sensors an account can see, but less obvious for getting bulk historic data.
What I want is to be able to grab historic data for all sensors relevant to the account, and be able to identify which sensor that data is associated with. Currently I only end up with a lot of data with information on which sensor it belongs to.
Is there a property that can be added to the historic data API call to return the object ID or sensor name?
This is what I have done so far: -
- Grab all the sensors for the account created with
- /api/table.json?content=sensors&columns=objid,group,device,sensor,status,message,lastvalue
- Navigate and Expand the list to get the record data.
- Convert this to a table.
- Expand the json values into columns.
- Add a new column combining the URL and ID together to create an full URL for historic data.
- /api/historicdata.json?id=" & Text.From([objid]) & "&avg=0&sdate=2018-11-02-00-00-00&edate=2018-11-02-23-59-59&usecaption=1)
- Add a custom column with the contents of the URL
- Convert this to a table
- Create a new column based on the JSON output from the URL
- data = List.Transform(#"Renamed Columns"[objecturl], each Json.Document(Web.Contents(_))),
- Convert this to a table
- Expand this column a few times to get the histdata as seperate columns.
Unfortunately I only see datatime, loading time, bytes received, download bandwidth, time to first byte and coverage - with no way to relate these back to the original object ID.
Add comment