cancel
Showing results for 
Search instead for 
Did you mean: 

rest api get all attribute set and its ids

SOLVED

rest api get all attribute set and its ids

I am working on a Rest API based "Add product" tool, starting with simple products. If I understand it correct, I need to know beforehand "attribute_set_id" for "Attribute set" such as Bag, Bottom, Default, Downloadable, Gear, Top or anything else that is there.

With this endpoint

POST <host>/rest/default/V1/products

I successfully managed to add a test product.

But I believe, based on the attribute set/product type I will need to have required and optional fields in order to successfully add the product. Where or how do I get this information? I have been looking for this information at https://devdocs.magento.com but I have not found it yet. Swagger at http://127.0.0.1/swagger does not help either.

So far using this Endpoint

GET <host>/rest/<store_code>/V1/eav/attribute-sets/list?
searchCriteria[filter_groups][0][filters][0][field]=attribute_set_name&
searchCriteria[filter_groups][0][filters][0][value]=Top&
searchCriteria[filter_groups][0][filters][0][condition_type]=eq

I was able to get attribute_set_id for "Top", how can can I get all attribute_set_name and id's at the same time for all the attribute set that exist in the Magento Store?

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: rest api get all attribute set and its ids

Hi @burgurprot35d3 

Try the below endpoint

rest/V1/products/attribute-sets/sets/list?searchCriteria=0


I hope it will help you!

View solution in original post

2 REPLIES 2

Re: rest api get all attribute set and its ids

Hi @burgurprot35d3 

Try the below endpoint

rest/V1/products/attribute-sets/sets/list?searchCriteria=0


I hope it will help you!

Re: rest api get all attribute set and its ids

@Vimal Kumar

Thanks a lot, it worked. Can you please also help me with figuring out all the required/mandatory and optional fields for each attribute set?