Different data via API than in awork's time reporting

Hello,

I am trying to re-create awork’s time reporting via the following request URI

https://api.awork.com/api/v1/timeentries?filterby=(projectId%20eq%20guid%270bc4828a-58a1-ed11-bf7a-14cb65277a35%27%20and%20isBillable%20eq%20true%20and%20startDateLocal%20ge%20datetime%272024-02-01T00:00%27%20and%20endDateLocal%20le%20datetime%272024-02-29T23:59%27%20and%20userId%20eq%20guid%27f8998900-f58f-ed11-ac20-501ac5270009%27)

I see in awork’s time reporting that there are 46:55 billable hours to this particular user and project in this particular month. But when I sum over the durations of the API’s response, I get 82500 (probably seconds, thus around 22:55 hours).

I would really appreciate you looking at "trace-id: f9be046635745260496e515771b79e39" and give me a hint to my problem :slight_smile:
Thank you in advance!

Melli

Hi @melli, your request and filter looks good. However, from this I can’t really tell how the sum of 46:55h was calculated. Looking at this project in awork, without a user filter, I see a lower amount of billable hours. Can you double-check and provide some more details as to where this number comes from?

Hey @Sebastian
I configured the time reporting as follows


with filters:

  • user: Selina
  • project: ABZÜ
  • time interval: 01.02.2024 - 29.02.2024
  • only billable hours

You can check the resulting Excel export here: Selina ABZÜ Februar.xlsx

While I was preparing these details for you, I noticed that it might be due to a timer that had not been stopped properly, on 16.02.2024. Looks like this time entry is contained in the above time reporting, but not in the API result. Can you confirm my guess? :slight_smile:

Quick update: I noticed that the said time entry did not contain a endDateLocal or endDateUTC. Thus, I updated my API request, such that time entries without endDate are also retrieved:
https://api.awork.com/api/v1/timeentries?filterby=(projectId%20eq%20guid%270bc4828a-58a1-ed11-bf7a-14cb65277a35%27%20and%20isBillable%20eq%20true%20and%20startDateLocal%20ge%20datetime%272024-02-01T00:00%27%20and%20(endDateLocal%20le%20datetime%272024-02-29T23:59%27%20or%20startDateLocal%20le%20datetime%272024-02-29T23:59%27)%20and%20userId%20eq%20guid%27f8998900-f58f-ed11-ac20-501ac5270009%27)

Is there a guide on which information is contained in which case for every API object such as time entries? :slight_smile:

Thank you!

So what I’ve found out so far is that there is one time entry that was started but never stopped. awork stopped it automatically after 24h. For some reason it did not get the end date and time set, which is the reason why it does not show up in the API response. This is a bug that we’re working on fixing. We will then correct the time entries where this was missing. So you should be able to rely on completed time entries showing up in the API response as well.