• 0
msterry

REST API - Get device history

Question

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.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 1

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

Share this post


Link to post
Share on other sites
  • 1

@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:

image.thumb.png.62e07f5172d166fc9b02ac4a3a67919e.png

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?

Share this post


Link to post
Share on other sites
  • 0

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!

Share this post


Link to post
Share on other sites
  • 0

@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 :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.