0

I would like to get more then one product's attributes options in one query I have my url for one attribute option as follow:

http://magento2.dev/rest/V1/products/attributes/size/options

The above I am receiving all the options for size, now the question is:

How do one get attribute options for colour in the same call?

e.g One could do http://magento2.dev/rest/V1/products/attributes/size|colour/options

passing parameters separated by pipe or comma whatever how can one do this in Magento 2?

Thank you in advance.

4

I've found out how to get list options I was looking for, it's possible to get attributes groups with array with options like so:

http://magento2.dev/rest/V1/products/attributes?&searchCriteria[filterGroups][0][filters][0][field]=attribute_group_id&searchCriteria[filterGroups][0][filters][0][value]=31

Where 31 is the attribute_group_id of custom attribute group MISC

  • Just to add you need admin rights to access this way – MePo Feb 20 '18 at 11:09
0

I think Magento2 doesn't allow to pass multiple options in this request. You can use the only one option at a time. You can refer webapi.xml file of catalog module under vendor directory.

You can create custom API for it. Here is an example to create custom REST API in Magento2. https://www.envisionecommerce.com/how-to-use-magento-2-rest-api/

  • Thank you for your suggestion. It seems that Magento API isn't so robust yet – Juliano Vargas Sep 27 '17 at 13:19
  • Perhaps there is another way what about GET attribute size and colour that belongs to an attribute group like a custom attribute e.g "MISC" then it will have size, colour etc.. and get all options is there way can be done Magento? – Juliano Vargas Sep 27 '17 at 13:26

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.