Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can find all information needed for authorization here.

Unobvious features

Features of processing date/time filters with options of group_by_interval

It is better to remember that analytics API can interpret arguments date_from and date_till differently in depending on the value of argument group_by_interval. If the value of group_by_interval is less than a day (e.g. 5m, 1hour, 6hours), then values of arguments date_from and date_till are interpreted as UTC time. The opposite situation is using values like day and week as values of the argument group_by_interval because in this case, the API makes calculations in the project’s timezones.

If Nwave Cloud gets a request for data about two projects located in different timezones, it tries to act in a way, which enables it to avoid ambiguous response interpretation. When a response should contain data grouped by minutes, or hours, API operates by UTC time to avoid the question “In what timezone is the data grouped”? At the same time, if the API receives a request on grouping data by days or weeks, it operates with local timezones because the midnight time is different for each timezone.

This approach leads to unobvious behavior. Let's look at an example:

Let’s imagine, that there are two parking projects in timezones UTC+0 and UTC+4. Two cars get into their own local parking at midnight between Monday and Tuesday by the 2nd project time (00:01:00+04:00).

With use of group_by_interval=1hour, we will see in the result for both projects the same: both cars have come in on Monday at 20:01:00+00 (UTC time for 00:01:00+04:00).

The opposite case if it is passed argument group_by_interval=day, because the same moment of entering cars into the parking has happened on different days in local timezones:

  • the first car came into 1st project on Monday 20:01:00+00

  • the second car came into 2nd project on Tuesday 00:01:00+04:00

This way, the request won't contain data about the entry of both cars at the same time like with the use of group_by_interval=1hour. It contains data about the entry of one car on Monday and the second on Tuesday.

API Description

Parking spaces states

...