API Events order

Forum for questions and support relating to the 1.29.x releases only.
Post Reply
Posts: 8
Joined: Tue Jan 26, 2016 2:03 pm

API Events order

Post by BananaPukeh » Sat Feb 06, 2016 3:13 pm

I'm trying to get the latest events for a monitor, but since the api only gives 100 events per request this requires a few more requests.

Is there a way to specify the sort order by event StartTime to descending, so I can get the latests events first?

User avatar
Posts: 1457
Joined: Sun Mar 01, 2015 12:12 pm

Re: API Events order

Post by asker » Sat Feb 06, 2016 3:33 pm

As far as I know, that is not possible today. The EventsController returns events sorted in ascending order. Having said that, CakePHP offers many ways to filter and if you figure out a syntax that works (take a look at http://book.cakephp.org/2.0/en/development/routing.html) let me know.

What I do is grab all pages of events and reverse it in my code.
Please don't ask me questions via PM. Feel free to post in the forums or Github

My collection of ZoneMinder learnings:

Posts: 1
Joined: Sat Apr 20, 2019 8:00 pm

Re: API Events order

Post by generalredneck » Mon Aug 26, 2019 3:47 am

Old post but really high on google search. What we are looking for is documented here:
https://github.com/ZoneMinder/zoneminde ... ted-events

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests