Detail report API to QlikSense

Hi,
I’m trying to use the clockify API to pull a detailed report into Qlik. For this I’m using a Qlik General Web Connector to just try and generate a csv. In the Qlik connector I’m using the following parameters:

Request Method: POST
Request URI: https://reports.api.clockify.me/v1/workspaces/xxxxxxxxxx/reports/detailed
POST Parameters:
{
“dateRangeStart”: “2022-01-22T00:00:00.000”,
“dateRangeEnd”: “2022-01-22T23:59:59.000”,
“detailedFilter”: {
“page”: 1,
“pageSize”: 50
},
“exportType”: “csv”
}

Content Type: application/json

Headers: X-Api-Key:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I receive the following error:
There was an error running the table (Failed on attempt 1 to POST. (The remote server returned an error: (400) Bad Request.){“code”:400,“message”:“Could not parse JSON”})

Any advice on what I’m doing wrong would be greatly appreciated.

Thanks

Hi Paula! Welcome to Clockify forum.

Can you please copy-paste this request body instead of yours (so we make sure that some formatting is not the cause) and let me know if the issue persists?

{“dateRangeStart”: “2022-01-22T00:00:00.000”,
“dateRangeEnd”: “2022-01-22T23:59:59.000”,
“detailedFilter”: {
“page”: 1,
“pageSize”: 50},
“exportType”: “CSV”}

Cheers!

Hi Natalie,
still receive the same erro when I copy and paste that into the Qlik Web Connnector:

Regards
Paul

Hi Paula,

Can you please check if this call works in Postman, since we have tested on our end everything is working as expected? Also, please double-check if you have closed curly brackets in the request body.

Cheers,

HI, thanks got it to work, it was just a formatting issue with the double quotes that was causing the issue.

I do have another question - in the api is it possible to pull a detail report for the current month without providing dateRangeStart & dateRangeEnd in the body?

As I’m connecting via a Qlik web connector I can’t programatically change these parameters.

Regards
Paul

Hi Paul,

Glad that it’s working now!

Unfortunately, the date range is a required field in the request body of the detailed reports endpoint.

Cheers!