0

I'm trying to use REST API with filters but apparently it doesn't work.

With http://192.168.10.99/api/rest/products/2 I get the following result:

<magento_api>
  <entity_id>2</entity_id>
  <type_id>simple</type_id>
  <sku>2</sku>
  <name>Borsa Gucci</name>
  <meta_title/>
  <meta_description/>
  <size_intl>16</size_intl>
  <description>borsa gucci</description>
  <short_description>borsetta</short_description>
  <meta_keyword/>
  <tier_price/>
  <is_in_stock>0</is_in_stock>
  <regular_price_with_tax>1000</regular_price_with_tax>
  <regular_price_without_tax>1000</regular_price_without_tax>
  <final_price_with_tax>1000</final_price_with_tax>
  <final_price_without_tax>1000</final_price_without_tax>
  <is_saleable>0</is_saleable>
  <image_url>http://192.168.10.99/media/catalog/product/cache/0/image/9df78eab33525d08d6e5fb8d27136e95/images/catalog/product/placeholder/image.jpg</image_url>
  <url>http://192.168.10.99/index.php/catalog/product/view/id/2/s/borsa-gucci/</url>
  <buy_now_url>http://192.168.10.99/index.php/checkout/cart/add/uenc/aHR0cDovLzE5Mi4xNjguMTAuOTkvYXBpL3Jlc3QvcHJvZHVjdHMvMg,,/product/2/form_key/wbRnSbkWsgjNy7KT/</buy_now_url>
  <total_reviews_count>0</total_reviews_count>
  <has_custom_options/>
</magento_api>

If then I try http://192.168.10.99/api/rest/products?filter[0][attribute]=entity_id&filter[0][in]=2 I get the following result:

*This XML file does not appear to have any style information associated with it.
The document tree is shown below.

<magento_api/>*

Where I'm doing wrong?

Thanks Alexio

1

Finally I've figured out what was the problem.

Without filters if the products exists in Magento it will be showed, but using filters it also need to be in stock (if you do manage stock).

Nice experience of debugging Magento even if the issue wasn't a bug :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.