I’m trying to retrieve all time entries for a given period with reports/detailed. The problem is that if I don’t give detailedFilter page/pageSize params the 50 entries limit is implicitly applied. How can I do it ?
In the case, all entries are only accessible page-by-page, how do I find how many pages there are?
You could go with pageSize param being set to 200, while page (number) would be a counter where it would grow by 1 each iteration with the condition of stopping the script being report having no data (since you are using totals exclude, if you include them, you may enter infinite loop due to totals being sent even on pages without any entries).
Yes, it helps. But honestly, that’s a bit strange (in terms of API design) as it cannot be predicted how many requests are needed. Usually, in other APIs I’ve seen, there is a total number of records or pages returned with the first response.
But anyway, thank you. It’s clear what to do
I’m glad that worked! And no worries, it’s easy to overlook a single piece of info like that when looking at the big picture.
If you need any assistance in the future, please stop by anytime, and if you happen to go through our API docs, and have any feedback about it, you can DM me here on forum and I will gladly pass it to the devs.
Half related to this, the thing that would really assist us is being able to retrieve timesheets based on the date they were created/updated, not the date they were entered for. We have users that go and edit old timesheets, and can’t always rely on the webhooks to send us a response