2

/V1/categories/(cat ID)/products

This API provides very less detail of all the products.

{
    "sku": "Nike 3 color half sleeve tshirt",
    "position": 1,
    "category_id": "3"
  },
  {
    "sku": "Louis Phillipe Blue Jean Size 32",
    "position": 1,
    "category_id": "3"
  },
  {
    "sku": "Louis Phillipe Shirt Size M",
    "position": 1,
    "category_id": "3"
  },
  {
    "sku": "UCB shirt Size ",
    "position": 1,
    "category_id": "3"
  },

I can use the sku in a search filter to get all the produts with these sku's. But is there a better way around ?

1

It is possible to use filter by category_id during request to Product Repository:

GET <base_url>/rest/V1/products

If it is necessary to filter by store_id or website_id at the same time, see workaround here.

  • For this I have to extend the API ? or is it possible by applying filters in the HTTP GET request itself ? – nr5 Dec 21 '15 at 6:17
  • Filter by category_id should work out of the box. The other 2 need a plugin for now, but this will be fixed in core in future releases. – Alex Paliarush Dec 21 '15 at 7:36
  • category_id can be used inside HTTP request ? I am on my way to work and cant run this query: 192.168.1.180/magento/index.php/rest/V1/…... can you check – nr5 Dec 21 '15 at 9:39
  • Yes, should work like this. – Alex Paliarush Dec 21 '15 at 9:40
  • It worked.. Its strange though. The response does not have any key named "category_id".. Can you take a look at this one: community.magento.com/t5/Programming-Questions/… – nr5 Dec 21 '15 at 9:56

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.