Question

I have made REST API callout to get products based filter criteria. Following is the endpoint. http://xxxxxxxx/magentodemo/rest/V1/products?searchCriteria[filter_g‌​roups][0][filters][0‌​][field]=updated_at& searchCriteria[filter_groups][0][filters][0][value]=2018-08-24 08:35:37&searchCriteria[filter_groups][0][filters][0][condition_type]‌​=eq. I got response as below.

{"message":"Internal Error. Details are available in Magento log file. Report ID: webapi-5b9f70d36a6c1"}.

I have gone through log file to check the Error Details.

[2018-09-17 09:16:03] main.CRITICAL: Report ID: webapi-5b9f70d36a6c1;Message: Invalid URI supplied {"exception":"[object] (Exception(code: 0): Report ID: webapi-5b9f70d36a6c1;Message: Invalid URI supplied at C:\\xampp\\htdocs\\magentodemo\\vendor\\magento\\framework\\Webapi\\ErrorProcessor.php:205,Zend_Uri_Exception(code: 0): Invalid URI supplied at C:\\xampp\\htdocs\\magentodemo\\vendor\\magento\\zendframework1\\library\\Zend\\Uri\\Http.php:156)"} []
Was it helpful?

Solution

Try this one instead, i think you have to encode the date, you have problem in the endpoint

/V1/products?searchCriteria[filter_groups][0][filters][0][field]=updated_at&searchCriteria[filter_groups][0][filters][0][value]=2018-08-24%2008%3A35%3A37&searchCriteria[filter_groups][0][filters][0][condition_type]=eq

OTHER TIPS

I had the same issue so i erased the var/cache folder contents and also the var/session folder content. Then refresh page and that should do it.

I have a similar problem, if the endpoint is

rest/V1/invoices/6 

I receive all the data of the invoice. If the endpoint is

rest/V1/invoices/?searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=2018-09-18%25&searchCriteria[filter_groups][0][filters][0][condition_type]=gt

I receive the error message: Invalid signature

Can anyone help me?

In order to return any error from restAPI Dont use \Exception it will not be shown as json if you are in production mode, It will work in development mode only, Implement Magento\Framework\Exception\ValidatorException and then even in production mode you will get the proper response in json format.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top