Hey Everyone!
I’ve been trying to connect to the Detailed Report API Enpoint (https://reports.api.clockify.me/v1/workspaces/{workspaceId}/reports/detailed ). But can’t seem to connect in any way. Latest error I’ve been getting is (400): Bad Request.
Any help would be appreciated!
The code I’ve been using is the following one:
let
Token = "MyClockifyToken",
Workspace = "MyClockifyWorkspaceId",
JSONbody = "{#(cr)#(lf)“dateRangeStart”: “2025-01-01T00:00:00.000”,#(cr)#(lf)“dateRangeEnd”: “2025-12-31T23:59:59.000”,#(cr)#(lf)“detailedFilter”: {#(cr)#(lf)“page”: 1,#(cr)#(lf)“pageSize”: 5000#(cr)#(lf)}",
Source = Json.Document(Web.Contents("https://reports.api.clockify.me/v1/workspaces/"&Workspace&"/reports/detailed",[
Headers = [#"x-api-key" = Token, #"Content-Type"="application/json"]
,Content = Text.ToBinary(JSONbody)
]))
in
Source```
David
February 12, 2025, 2:00pm
2
Hello Franco,
Thanks for using the Clockify Forum!
Would you mind reaching out to the Support Team at support@clockify.me so that we can tackle this issue?
Kind regards,
Hey David! I was able to connect via Power BI using the following code:
let
Token = "YourClockifyToken",
Workspace = "YourClockifyWorkspace",
Url = "https://reports.api.clockify.me/v1/workspaces/" & Workspace & "/reports/detailed",
JSONbody = "{""dateRangeStart"": ""2024-06-01T00:00:00.000"",#(cr)#(lf)""dateRangeEnd"": ""2024-12-31T23:59:59.000"",#(cr)#(lf)""detailedFilter"": {#(cr)#(lf)""page"": 1,#(cr)#(lf)""pageSize"": 50},#(cr)#(lf)""exportType"": ""CSV""}",
Source = Csv.Document(Web.Contents(Url,[
Headers = [#"X-Api-Key"=Token, #"Content-Type"="application/json"]
,Content = Text.ToBinary(JSONbody)
]))
in
Source```
IanB
February 25, 2025, 9:56am
4
Hi Franco,
If it helps, I did put an example of how I managed to connect to the API using Powerquery in the below article. I appreciate you have solved your issue for now, but you never know, it could be useful for you going forward.
Hi Holger,
Thank you very much for your assistance and providing a sample of your work, I really appreciate it.
I managed (after a lot of trial and error) to get Postman to build a request that worked for me and then started messing around with the Power Query to get it to do what I wanted. It is mostly there at this stage.
I am a firm believer in sharing knowledge with the masses, to better educate and in the hopes it might help someone else who is having the same issues I am, so here is wha…
Hope it helps!