pythonapigetrate-limitingexact-online

How to deal with ratelimit off booked project hours - Exact Online


My goal is to get the hours booked on projects for the years 2020-2021 from Exact Online. Currently, I am trying to get the right data with Postman and afterward I want to implement it in Python. I use the project/TimeTransaction API.

The API call I am doing:

https://start.exactonline.nl/api/v1/<division_code>/project/TimeTransactions?$select=ID,Activity,ActivityDescription,Date,ProjectDescription,ProjectCode,Quantity,ModifierFullName,Modified,HourStatus,CreatorFullName,Attachment,ItemDescription,Type

Unfortunately, the GET request returns only the hours booked in 2013, 2014, and 2015. This is caused by the page size of 60 rows per call (you get only 60 records of data per request).

I tried to overcome this problem by making use of the skiptoken, for which the next value is given at the end of every request. The function of the skiptoken is to get the next 60 records of data. I have tried this multiple time but still I only receive the hours of 2013, 2014, and 2015. In addition, I used an hourentryID of 2021 as skiptoken (so what I would expect is to only get hours from 2021) but again only hours from 2013, 2014, and 2015.

The URL with skiptoken looks like this:

https://start.exactonline.nl/api/v1/<division_code>/project/TimeTransactions?$select=ID,Activity,ActivityDescription,Date,ProjectDescription,ProjectCode,Quantity,ModifierFullName,Modified,HourStatus,CreatorFullName,Attachment,ItemDescription,Type&;$skiptoken=guid'1aa0ec3d-e40f-45e5-99de-03b04580c8e9'

Anyone familiar with this problem and able to help me?


Solution

  • As pointed out by Guido Leenders, you need a filter. The following example eliminates all time transactions with a Date prior to January 1, 2020.

    $filter=Date ge DateTime'2020-01-01'
    

    This would make the full URI:

    https://start.exactonline.nl/api/v1/<division_code>/project/TimeTransactions?$select=ID,Activity,ActivityDescription,Date,ProjectDescription,ProjectCode,Quantity,ModifierFullName,Modified,HourStatus,CreatorFullName,Attachment,ItemDescription,Type&$filter=Date ge DateTime'2020-01-01'