Power BI API Connector for Detailed Report

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```

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```

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.

Hope it helps!