Page 1 of 1

ZAutomation API notifications since timestamp ignored

Posted: 05 Jun 2018 02:04
by optimax
Hi I am trying to use the ZAutomation notifications REST end point with a "since" timestamp query parameter.
I have a RazBerry board and firmware version 2.3.7.

"GET /ZAutomation/api/v1/notifications" works fine and returns about 1950 notifications.

"GET /ZAUtomation/api/v1/notifications?since=1528128000" seems to ignore the "since" query string parameter and returns the exact some number of notifications, including all notifications with timestamps prior to "since" parameter. The "since" parameter has no effect, whatever value is used in the request.

Has anyone successfully retrieved a limited number of notifications with the "since" query string parameter, or is this REST end point buggy ?

Looking forward to any comments or suggestions !

Re: ZAutomation API notifications since timestamp ignored

Posted: 05 Jun 2018 02:21
by PoltoS
There should be two more digits. May be it is not that clear, but it is the timestamp in 10ms units ;) Look on id - it is same format as since and to

Re: ZAutomation API notifications since timestamp ignored

Posted: 05 Jun 2018 10:01
by optimax
Thanks for pointing me in the right direction.

I looked at the "id" fields of the notifications response and realized that they are in ms since epoch, so I need to add 3 digits to the query parameter.
The latest notifications are now filtered correctly.

"updateTime" field of the response, however, is in seconds since epoch, which is a bit misleading.

I wish the documentation in https://zwayhomeautomation.docs.apiary.io would be a bit more detailed on the formats...

Thanks for your help !