Hey everyone!
I’m writing a CLI tool for my team using Clockify API. I’m at the point where I need to get the total work hours of the user using https://reports.api.clockify.me/v1/workspaces/WORKSPACE_ID/reports/summary
, but I’m always getting this error {"code":403,"message":"You don't have a permission for that action"}
although I could view the summary reports when using the browser. Do you know why it fails on my code (or simple curl
command), but it’s working using a browser? Thanks!
Here’s the curl that I used to test it:
curl --request POST \
--url https://reports.api.clockify.me/v1/workspaces/WORKSPACE_ID/reports/summary \
--header 'content-type: application/json' \
--header 'x-api-key: CLOCKIFY_API_KEY' \
--data '{
"dateRangeStart": "2024-04-01T00:00:00.000Z",
"dateRangeEnd": "2024-04-30T23:59:59.000Z",
"summaryFilter": {"groups": ["PROJECT", "USER", "TIMEENTRY"]},
"exportType": "JSON",
"users": {
"ids": ["USER_ID"],
"contains": "CONTAINS",
"status": "ALL"
}
}'
{"code":403,"message":"You don't have a permission for that action"}%