Forum Discussion

msterry's avatar
7 years ago

REST API - Get device history

Is there a way to capture the datasource history? 

I tried combining through the forums and REST API instructions, but wasn't able to find anything. I would expect something like '/setting/datasources/XXXXXX/history'. 

I can access this via the UI - "settings --> datasources --> [Any datasource] --> click the "Show History" button.

  • Hi,

    There is a resource for requesting DataSource history, but we haven't published it yet. We will get it into the queue for an upcoming release.

    Thanks,

    Sarah

  • Sarah_Terry's avatar
    Sarah_Terry
    Icon for Product Manager rankProduct Manager

    Hi,

    There is a resource for requesting DataSource history, but we haven't published it yet. We will get it into the queue for an upcoming release.

    Thanks,

    Sarah

  • hey @Sarah Terry I was just search for "history" and ran across this.. I was just looking at a resource and thinking boy it would be nice if right next to the Alerts tab was a History tab (or maybe it could just show on the same Alerts tab as old alerts... basically a quick way to see has this instance alerted before and when ? Which would be great for the normal user!

  • Sarah_Terry's avatar
    Sarah_Terry
    Icon for Product Manager rankProduct Manager

    @Keimond are you looking just for alert history for a particular device? You can see alert history at the alert level - on the Alerts page or on the Alerts tab for a resource, you'll see a history tab when you select an alert:

    But the history is tied to the alert, not the device or instance itself. The ability to retrieve this info isn't published for our REST API, but we could publish it.

    The other option would be to query alerts for a particular device, and look at only cleared alerts that occurred during a specific time window - so the request might look like:

    GET /device/devices/1/alerts?filter=cleared:*,endEpoch<1524170891,startEpoch>1523567577

    And that'd show you alerts that occurred for device 1 in the past week.

    Do either of these help with the information you're trying to get?

  • @Sarah Terry Thank you !!! That helps out a lot, that answer doesn't seem to be very straight forward for the common user. Especially when an alert is cleared. The user has to know then if they want to go see history on an instance that when they go to the alerts tab on that instance, they also have to change cleared to all to see past alerts then click on history. -- which is why a tab right next to alerts might be nice, or a visible "history" button under the alerts tab so that the common user can easily have a link to see history.  At least for now it's just a matter of training everyone :)/emoticons/smile@2x.png 2x" title=":)" width="20">