Reports API

Hi there. I am trying to get the following post body to get a report exactly like the image and following the parameters: Project is = to “Hiring” or “Onboarding” and Client is =“Client1

Here is the image.

Please please, if someone can assist with this it would be so helpful. I’m such a beginner at API and have been trying by trial and error for days now.

Thanks! :smiley:

Hi Andrew, welcome to Clockify Forum!

Are you trying to request a detailed report for Jan 22nd filtered by client and project?
If this is the case, first you need to add your API key to the headers, as well as the “content-type: application/JSON”.
The URL for a detailed report is - https://reports.api.clockify.me/v1/workspaces/{YourWorkspaceId}/reports/detailed and the method is POST.
In addition to this, please see the below body part:
{
“dateRangeStart”: “2022-01-22T00:00:00.000”,
“dateRangeEnd”: “2022-01-22T23:59:59.000”,
“detailedFilter”: {
“page”: 1,
“pageSize”: 50
},
“exportType”: “CSV”,
“clients”: {
“ids”: [“YourClientId”],
“contains”: “CONTAINS”,
“status”: “ALL”
},
“projects”: {
“ids”: [“yourProjectId”],
“contains”: “CONTAINS”,
“status”: “ALL”
}
}

If this is not what you were referring to, please let us know.

Hi there.

I think to get the date column like it is in the picture. I might need to use the summary report no?

It would then group it all by the month. January / Feb ect.

Hi again,

you can use the summary report grouping option and group it by month.

Here is the example:
{
“dateRangeStart”: “2021-11-01T00:00:00.000”,
“dateRangeEnd”: “2021-11-30T23:59:59.000”,
“summaryFilter”: {
“groups”: [
“MONTH”,
“PROJECT”,
“TIMEENTRY”
]
},
“exportType”: “CSV”
}

Hope this helps!

Hello,

I have been tryng to validate the API using postman but I keep receiving this error.

I have been tryng for a while and I would appreciate a lot if someone could give me a hint towards the sollution.

Thanks!

Hi Octavio, welcome to Clockify Forum!

Thank you for your screenshot as it helps a lot in this case. Kindly note that it is not possible to use summary filter options when trying to pull a detailed report.
This being said, please note that there are some required body parts for the detailed report:

{
“dateRangeStart”: “1982-01-01T00:00:00.000”,
“dateRangeEnd”: “2022-12-31T23:59:59.000”,
“detailedFilter”: {
“page”: 1,
“pageSize”: 50
}
}

Hope this will help. Reach back if you have more questions.
Cheers!

1 Like