Note that by default the API paginates, with 50 entries per page, which may exceed the number of devices that you get. In that case, you’ll either want to handle iterating through the pages (not sure how that works in Power BI), or attach an additional parameter like “&per_page=100”, to get 100 in a page. The maximum value of per_page is 1000–if you have more objects than that, you’ll need to use pagination.
Let me know if this solves your issue, or if you have any questions.
It looks like I am connecting but am going to the wrong url now and Power BI won’t accept the redirect.
I did some research and I need to get a list of devices and then do a loop query based on the device list. I tried getting the list of devices but get the same redirect error.
Hi @mahouser - it looks like the authentication may be the issue? Have you tried setting up HTTP BasicAuth to encode the API Key? It looks like you’re using the Power BI UI - according to their docs, it should prompt you to authenticate after you’ve made the API call at which point you can select “Basic” and enter the username (API key) and password (leave blank).
Awesome. I’m glad that worked! To get data for all the devices, you’ll need to iterate over the serial numbers of the devices you’d like to grab data for. If you can summarize what you’re trying to do, I can at least write some pseudo-code for you that should be doable in Power BI.
Greetings again. I am able to pull the sensor data now, but it looks like I am only seeing the last 2 days. I see on the website that it mentions that data is deleted after 30 days, but I can see data in different visuals that go back months. Is there any way to get that historical data for long term trend analysis or do I need to download it and analyze historical data that way?
Another question - how can i get a complete list of devices in the network and their status? I can’t see the offline instruments when i pull the device list.
Hi @mahouser - what is the API call you’re making? The list of devices returned shouldn’t depend on the status of the device. If you can provide an example, I’ll look into it and see if there is a bug.
Hi @mahouser, sorry for missing this one. Data is never deleted from our platform. The files you create when downloading data are deleted after 30 days, but the actual data is not. You can download all data via the API. Can you provide an example of the API call you’re making?
I could not get more than 50 on a page, but I was able to add a second page to the report and get them. Question - is there a way to filter by Active Status from the Device List during the data pull and in theory only return the 32 active ones so I don’t have to add a second page and then filter out?
I will have to look into whether or not that is currently supported. Though, if so, it would likely also require a filter, which doesn’t appear to be working if you can’t return more than 50 per page. Do any filters work on any of your API calls?
Actually, I was able to add the “missing” sensors by changing “v1/devices/?page=1&?per_page=50?org_id=1218&network_id=57” to "v1/devices/?page=2&?per_page=50?org_id=1218&network_id=57, so I guess that worked as a filter in a way . But changing “per_page” to 100, it still returned 50.