Using timeend and/or timestart on /usage/data/daily endpoint gives 0 results

When accessing the /usage/data/daily endpoint I can get a list of entries from May (2018-05-14) until now (2018-08-23). However when I use the documented timeend and timestart request params to specify a date range in this period the result set is always empty, even though when just the time params are ommitted from the request there are entries for dates in this range.

The params I supply are:
‘apikey’ => ***
‘orgid’ => ***
‘timeend’ => ‘1533095999999’ // GMT: Wednesday, 1 August 2018 03:59:59.999
‘timestart’ => ‘1530417600000’ // GMT: Sunday, 1 July 2018 04:00:00
‘limit’ => ‘5000’
‘tagname’ => ***

I believe (just from the example) the API expects Unix time in seconds, your example is in milliseconds, so use:

‘timeend’ => ‘1533095999’ // GMT: Wednesday, 1 August 2018 03:59:59.0
‘timestart’ => ‘1530417600’ // GMT: Sunday, 1 July 2018 04:00:00.0
2 Likes

Thanks! The documentation just mentions “(Unix timestamp)” and I’d assumed it was milliseconds

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.