Error while using filters with URL (cURL) of REST API

I tried using following code as directed at
But I am getting errors. I wish to fetch price for item_code via REST API.

$urls = ‘Frappe Cloud Price/?filters=[“Item%20Price”, “item_code”, “=”, “bk1”]"’;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $urls);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$ipjson = curl_exec($ch);
print $ipjson;
curl_close ($ch);


Bad Request
Invalid HTTP Version ‘Invalid HTTP Version: ‘“item_code”, “=”, “bk1”]" HTTP/1.0’’

I tried changing URL but still theres an error.

$urls = ‘Frappe Cloud Price/filters=[“Item%20Price”, “item_code”, “=”, “bk1”]"’;


Not Found
./ does not exist

Your formatting for filters is wrong. You are missing a set of square brackets and you have an extra quotation on the end.

try this:

$urls = 'Frappe Cloud Price/?filters=[[“Item%20Price”, “item_code”, “=”, “bk1”]]`;

Thanks Ben.

I corrected and tried according to your reply. But still its not getting through. Error appears.

Bad Request
Invalid HTTP Version ‘Invalid HTTP Version: ‘“item_code”, “=”, “bk1”]] HTTP/1.0’’

I had a mistake in my suggestion. You have an extra forward slash before the ?:

$urls = '[["Item%20Price", "item_code", "=", "bk1"]]`;

A couple other suggestions if this doesn’t work:

  1. Have you made sure your URL is encoded properly (so that quotations/spaces are properly handled)?
  2. Have you logged in? What URL did you use for logging in?