API Events order

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

API Events order

Post by BananaPukeh »

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
asker
Posts: 1553
Joined: Sun Mar 01, 2015 12:12 pm

Re: API Events order

Post by asker »

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.
I no longer work on zmNinja, zmeventnotification, pyzm or mlapi. I may respond on occasion based on my available time/interest.

Please read before posting:
How to set up logging properly
How to troubleshoot and report - ES
How to troubleshoot and report - zmNinja
ES docs
zmNinja docs
generalredneck
Posts: 1
Joined: Sat Apr 20, 2019 8:00 pm

Re: API Events order

Post by generalredneck »

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