I'm trying to create an API Call which returns me the user presences for a certain interval. Currently I'm using v2/analytics/users/details/query with this body
If you want to know how much time was apportioned per interval you need to use an aggregate endpoint.
Details endpoints only bring back everything that occurred/overlapped the interval specified.
Different meanings of interval in each.
Does the overlapping also count for the aggregates?
If I have, e. g. two intervals from 12 - 12:30 as well as 12:30 to 13:00 - would a presence set from e. g. 12:15 - 12:45 be counted in both aggregates?
Aggregates are designed to conform your data into the interval sizes you ask for. You tell it the size to break your interval-range into, whether that's 1, 5, 15, 30, 60 minutes or an entire day, and the other dimensions you want to group by, and it creates a unique representation of the intersection of those intervals and your dimensions.
If you ask for it to break them out in 30 minute chunks you'll get however many 30 minute chunks fit in the interval-range you've asked for, no overlaps.
If you ask for 8 am to present at 9 am you'll get up to two chunks (and possibly a third incomplete if 9 is already active)
If you ask it again at 10 am you'll get 4 but the first two will be unchanged and consistent with what you've already received, the 9 if you'd gotten it previously would likely be different since it'd now be complete and the 9:30 to 10 would be present and new. This is why aggregates are ideal for incremental data loading because you can merge on your key and only update the pieces that have actually changed since your last iteration.
In your example if you were doing 30 minute intervals 15 minutes would be in each of the two intervals (12-12:30, 12:30-1) for a 12:15 to 12:45. If you did a 15 minute interval there would be four intervals and the time would be counted in 12:15-12:30, 12:30-12:45 and the 12-12:15 and 12:45-13 intervals would be nonexistent)