Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
aguirre
Creator
Creator

400 Bad Request for qrs api call

Hello,

I would like to get app id from app name with QRS api but I am getting this error:

Bad Request HTTP Error 400. The request is badly formed.

I use php code.

If the endpoint is 

$endpoint = "https://mysvr:4242/qrs/about?xrfkey=0123456789abcdef";

or

$endpoint = "https://mysvr:4242/qrs/about/api/description?extended=true&method=GET&format=JSON&xrfkey=0123456789a...";

it works.

But if I try:

$endpoint = "https://mysvr:4242/qrs/app?xrfkey=0123456789abcdef&filter=Name eq 'myAppName'";

I get 

Bad Request

HTTP Error 400. The request is badly formed

Another endpoint with the same error is:

$endpoint = "https://mysvr:4242/qrs/user/count?xrfkey=0123456789abcdef&filter=Name eq 'My Name'";

Do you know what it could be?

 

Below the rest of my code.


$headers = array(
'Accept: application/json',
'Content-Type: application/json',
'x-qlik-xrfkey:0123456789abcdef',
'Connection:Keep-Alive',
'X-Qlik-User: UserDirectory=Internal;UserId=sa_repository'
);

 

$url = $endpoint;
$certFile = "c:/inetpub/wwwroot/phpad/cert.pem";
$keyFile = "c:/inetpub/wwwroot/phpad/key.pem";

$request = curl_init();
$options = array(
CURLOPT_URL => $url,
CURLOPT_SSLCERT => $certFile,
CURLOPT_SSLKEY => $keyFile,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_HTTPHEADER => $headers,
);
curl_setopt($request, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt_array($request, $options);
$response = curl_exec($request);

Labels (1)
1 Solution

Accepted Solutions
aguirre
Creator
Creator
Author

I managed. I only need to html encode:

$endpoint = "/app?xrfkey=0123456789abcdef&filter=name+eq+%27myappname%27";

View solution in original post

1 Reply
aguirre
Creator
Creator
Author

I managed. I only need to html encode:

$endpoint = "/app?xrfkey=0123456789abcdef&filter=name+eq+%27myappname%27";