Magento 2 – Retrieve All Product Attributes Using REST API

attributesmagento2product-attributerest api

I am new to magento2 and learning using rest API of magento2.

I want all products to attribute that is present in the database. I searched in the database and I found that the table eav_attribute contains all attrs.

I would like to retrieve all these attributes using rest API.
I have tried the following endpoints:

rest/V1/products/attribute-sets//attributes
rest/V1/eav/attribute-sets/list?searchCriteria... field attribute_set_name
rest/V1/eav/attribute-sets/list?searchCriteria... field entity_entry_id

and more others but I am not able to find.

I have tried this too. rest/V1/products/attribute-sets/9/attributes
but I don't get all attributes. I.e the color attribute available in Magento admin but I can't get using rest api.

Please, can you help me?

Best Answer

What I wanted I achieved by this endpoint /rest/V1/products/attributes

and using this search Criteria

$params= ['searchCriteria' => 
               ['filterGroups' => 
                        [0 => [
                             'filters' => [ 
                                         0 => [ 
                                            'field' => 'attribute_id', 
                                            'value' => 1, 
                                            'condition_type' => 'gteq' 
]
        ]]]]];
Related Topic