2

I need to get the attribute code by attribute id with rest api. This is needed for configurable product. I get the configurable product data:

 "extension_attributes": {
 "website_ids": [
 1
 ],
 "configurable_product_options": [
 {
 "id": 2568,
 "attribute_id": "253",
 "label": "Size",
 "position": 0,
 "values": [
 {
 "value_index": 1847
 },
 {
 "value_index": 1844
 },
 {
 "value_index": 1845
 }
 ],
 "product_id": 25539
 }
 ],
 "configurable_product_links": [
 25540,
 25541,
 25542
 ]
 },

The 'configurable_product_options' has no attribute_code, I need it to find the value of the value_index which is the option id. How to get the attribute_code?

asked Jul 1, 2020 at 13:36

1 Answer 1

1

Magento 2 Provide the rest API to get the product attributes value and its option

you can try this API catalogProductAttributeRepositoryV1 and you can pass the attribute_id instead of the attribute_code.

enter image description here

I hope this is helpful to you!!

answered Jul 2, 2020 at 4:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.