Empty Report from Detailed API?

Trying to get a detailed report for my workspace using this:

{
  "exportType": "JSON",
  "dateRangeEnd": "2023-08-31T23:59:59Z",
  "dateRangeStart": "2023-01-01T00:00:00Z",
  "sortOrder": "DESCENDING",
  "detailedFilter": {
    "pageSize": 1000,
    "page": 1,
    "sortColumn": "DATE"
  }
}

But even though there are ~ 500 entries that match that for that date range, I’m getting an empty result set and can’t quite figure out why. Any ideas? Not getting any errors (now), but I can’t figure out what I’m doing wrong.

1 Like

Well, answered my own question here. When I was trying to get my Workspace ID initially, I had accidentally done a POST and created a second workspace in my account. It doesn’t show anywhere else (as I have a “free” account) so now trying to figure out how to remove that. But I could use it to retrieve my data set from that empty/unused workspace and was doing that repeatedly.

Still having issues using PowerShell to try to pull the file in Excel format, but I can pull my full report in CSV without issue.

Now to find the right command to delete the bad workspace. :slight_smile:

Hi Paschott,

You can delete the unused workspace by using the delete call found here Clockify API Documentation. You will need to use the unused workspace ID and your own user ID.

Cheers!

OK - that looked like it was to remove a user, not a workspace. I did finally see it show up in my interface. It just took a while and some refreshing. I deleted using the UI.

For the Excel file output, there’s something different about grabbing the output using

$results = Invoke-RestApi
$results | out-file $excelfile

and

Invoke-RestApi -Outfile $excelfile

Not really sure why but using the latter worked.