Im currently pulling in all Hardware created after a set date, but i cant easily see a way to get the last 20 entries? Whats the best way to do this?
Something like https://api.samanage.com/hardwares.json?last=20 would be perfect if it was a thing.
Im currently pulling in all Hardware created after a set date, but i cant easily see a way to get the last 20 entries? Whats the best way to do this?
Something like https://api.samanage.com/hardwares.json?last=20 would be perfect if it was a thing.
Great question! I never thought to test/use this.
You can achieve something similar to what you're requesting by requesting per_page=20, page=1, and then using the sort_by= and sort_order= arguments to change the order in which the results are filtered.
For example, to get the newest 20 incidents:
https://api.samanage.com/incidents.json?per_page=20&page=1&sort_by=created_at&sort_order=DESC
For the oldest 20 incidents:
https://api.samanage.com/incidents.json?per_page=20&page=1&sort_by=created_at&sort_order=ASC
You can discover the different options by sorting the columns in the web interface, and then looking at the arguments that show up in the URL afterwards. This should work for other endpoints in addition to /incidents
SolarWinds solutions are rooted in our deep connection to our user base in the THWACK® online community. More than 195,000 members are here to solve problems, share technology and best practices, and directly contribute to our product development process.