ZAutomation API notifications since timestamp ignored

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
optimax
Posts: 2
Joined: 05 Jun 2018 01:49

ZAutomation API notifications since timestamp ignored

Post by optimax » 05 Jun 2018 02:04

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 !

User avatar
PoltoS
Posts: 4302
Joined: 26 Jan 2011 19:36

Re: ZAutomation API notifications since timestamp ignored

Post by PoltoS » 05 Jun 2018 02:21

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

optimax
Posts: 2
Joined: 05 Jun 2018 01:49

Re: ZAutomation API notifications since timestamp ignored

Post by optimax » 05 Jun 2018 10:01

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 !

Post Reply