Reputation: 31
Hi I was wondering if you could help me.
What would be the right endpoint to get a report for hours logged for each user in a given workspace the past 24 hours? The API doesn't make it clear which report to use and what values to supply in a post request to get this result.
Excuse me if I seem a little naive about the capabilities, I have been asked to look at this without prior knowledge of the API and I'm just trying to get me head around it.
Upvotes: 0
Views: 1181
Reputation: 554
Clockify just seem to have shut down their old api (I was using). The report API is documented here: https://clockify.me/developers-api#tag-Reports
And this works quite well. For your case, the requests could look like:
curl --request POST \
--url https://reports.api.clockify.me/v1/workspaces/<YOUR WORKSPACE>/reports/summary \
--header 'content-type: application/json' \
--header 'x-api-key: <YOUR API KEY>' \
--data '{
"dateRangeStart": "2020-08-13T00:00:00.000Z",
"dateRangeEnd": "2020-08-13T23:59:59.000Z",
"summaryFilter": {"groups": ["USER"]},
"exportType": "JSON"
}'
There is no "last 24h" though, you will have to adjust the dates yourself.
What might be interesting for your case:
TIMEENTRY
as summary group: "groups": ["USER", "TIMEENTRY"]
JSON
, CSV
, XLSX
, PDF
are supported.Upvotes: 1