Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE

Interacting with Qlik SaaS APIs using curl on Windows may generate an error: “Invalid request”

No ratings
cancel
Showing results for 
Search instead for 
Did you mean: 
Bjorn_Wedbratt
Former Employee
Former Employee

Interacting with Qlik SaaS APIs using curl on Windows may generate an error: “Invalid request”

Last Update:

May 10, 2022 1:43:00 PM

Updated By:

Jamie_Gregory

Created date:

Aug 25, 2021 6:42:36 AM

Using curl on Windows to interact with Qlik SaaS API may give you an error, like the one below:

{"traceId":"67d14d4c1cd2410595748ce67ac04c88","errors":[{"code":"RELOADS-001","title":"Invalid request."}]}

The above is a result of using the Reloads endpoint to reload an app as outlined here: https://qlik.dev/apis/rest/reloads#%23%2Fentries%2Freloads-post

 

curl "https://your-tenant.us.qlikcloud.com/api/v1/reloads" \
 -X POST \
 -H "Authorization: Bearer <API-key>" \
 -H "Content-type: application/json" \
 -d '{"appId":"116dbfae-7fb9-4983-8e23-5ccd8c508722","partial":true}'

 

Environment

 

Resolution

Here is a working example for curl on Windows. Note the change in using double quotes (“) instead of single quotes (‘) around the body as well as escaping (\) the double quotes inside the body.

Also note the use of ^ instead of \ for line breaks.

 

curl "https://your-tenant.us.qlikcloud.com/api/v1/reloads" ^
 -X POST ^
 -H "Authorization: Bearer <API-key>" ^
 -H "Content-type: application/json" ^
 -d "{\"appId\":\"116dbfae-7fb9-4983-8e23-5ccd8c508722\",\"partial\":true\"}"

 

Cause

This is an artifact of curl on Windows. The above example is for Linux/Mac OS systems and quoting and escape characters are a bit different on Windows.

Labels (1)
Version history
Last update:
‎2022-05-10 01:43 PM
Updated by: