As i understand the documentation, calls to:
/V1/products/attributes/{attributeCode}
/V1/products/attributes/
should return frontend labels for the attribute and for options.
Like this for options:
"options": [
{
"label": "string",
"value": "string",
"sortOrder": 0,
"isDefault": true,
"storeLabels": [
{
"storeId": 0,
"label": "string"
}
]
}
]
and like this for attribute label
"frontendLabels": [
{
"storeId": 0,
"label": "string"
}
]
In my tries i only get the default store view labels and values for options and null for the attribute labels like this:
"options" : [
{
"label" : "string",
"value" : "string"
}
],
.
.
.
"frontend_labels" : null
Magento version is 2.0.2
/Thomas
Any news on this?
Not fixed in 2.10
Do you try to use it in format /rest/{store_code}/V1/products/attributes/{attribute_code}/? It return for me labels for store.
on all storecodes frontend_labels remain null.
is there also a store view for admin labels?
once a translation is set for an option is seems impossible to get the admin label
i tryd
/rest/admin/V1/products/attributes/{attribute_code} < no route
/rest/default/V1/products/attributes/{attribute_code} < options label are translated to default
/rest/{store_code}/V1/products/attributes/{attribute_code} < options labels are translated to test
also the restult of options does not match the swagger documentation
i get:
"options": [
{
"label": " ",
"value": ""
},
{
"label": "Phil default",
"value": "91"
},
{
"label": "aoc default",
"value": "88"
}
],
following swagger it should look like:
eav-data-attribute-option-interface {
label (string): Option label ,
value (string): Option value ,
sort_order (integer, optional): Option order ,
is_default (boolean, optional): Default ,
store_labels (Array[eav-data-attribute-option-label-interface], optional): Option label for store scopes
}
The last 3 fields are missing
edit changed admin value to admin label
if you use
/rest/all/V1... you can get the labels used on the admin view
To bad it is not documented how you use storeviews in the rest api.
/1/store/storeView says:
[
{
"id": 1,
"code": "default",
"name": "Default Store View",
"website_id": 1,
"store_group_id": 1
},
{
"id": 0,
"code": "admin",
"name": "Admin",
"website_id": 0,
"store_group_id": 0
}
]
But to get admin you need to use all :-1:
I can concur robg66 findings, still looking for a solution.
Hello all
Also looking forward to the solution. This is critical for our integration
A note: all frontend labels (labes for all store views) are not needed, only a single store_code-specific label value is needed from these calls. It looks somewhat confusing that /rest/{store_code}/V1/products/attributes lists only store_code-specific option labels but is supposed to return attribute labels for all store views. It would be appropriate to include single store_code-specific "frontend_label" in the response next to "default_frontend_label" or even instead of it
Any news on this? I have the same issue....
Not fixed in 2.1.2 btw
The main goal for me is to retrieve an option with all its labels, or a call to update labels and leaving the rest of the labels as it was.
Why is this taking a year to fix?
Thanks for reporting the issue. I was able to reproduce and filed internal ticket MAGETWO-64315.
Hello, I just want to know status about this issue. There is no possibility to get translated attribute frontend label - also with store code in API URL.
We still got default attribute label...
Hi! I'am also interested in this issue. I need to translate external option codes into dropdown-type attributes, and I can't find a feasible way to map Magento's dropdown autoassigned values to my external codes.
@misha-kotov Is it already planned when this bug will be fixed? Should we wait or we should find another way how to get real attribute label for store view?
Thanks
Hi, this is only a dirty workaround but you can get some ideas, just in case you really need to implement something:
$connection= $this->resourceConnetion->getConnection();
$select = $connection->select()
->from(
['t1' => $this->resourceConnetion->getTableName('eav_attribute_option_value')]
)->join(
['t2' => $this->resourceConnetion->getTableName('eav_attribute_option')], 't1.option_id=t2.option_id'
)->join(
['t3' => $this->resourceConnetion->getTableName('eav_attribute')], 't3.attribute_id=t2.attribute_id'
)->where(
't3.attribute_code = ?', 'your_attribute_code'
)->where(
'store_id = ?', 0//for the admin labels
);
$result = $connection->fetchAll($select);
Hello,
A dirty quick fix is to rewrite the attribute repository before Magento fix it.
And append the store_code to the rest API.
<?php
namespace Vendor\Module\Model\Product\Attribute;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Repository extends \Magento\Catalog\Model\Product\Attribute\Repository
{
/**
* {@inheritdoc}
*/
public function get($attributeCode)
{
$attribute = $this->eavAttributeRepository->get(
\Magento\Catalog\Api\Data\ProductAttributeInterface::ENTITY_TYPE_CODE,
$attributeCode
);
return $attribute->setDefaultFrontendLabel($attribute->getStoreLabel());
}
}
@thomasnordkvist, thank you for your report.
We've created internal ticket(s) MAGETWO-64315 to track progress on the issue.
For anyone who want to fix it without waiting magento fix. Here is the fix from me.
https://github.com/4dhk/magento2/commit/32d3cbb53b4f74fcf4f7753500748e215221d37f
Feel free to comment for a better way to do it.
@magento-engcom-team
Magento 2.3
rest/all/V1/products/attributes/{attribute_code}
"options":[
{
"label":" ",
"value":""
},
{
"label":"Default",
"value":"4"
},
{
"label":"Default 1",
"value":"5"
},
{
"label":"Default 2",
"value":"6"
}
],
"is_user_defined":true,
"default_frontend_label":"Color",
"frontend_labels":[
{
"store_id":1,
"label":"Default Store View Lable"
},
{
"store_id":2,
"label":"Test Store View Lable"
}
],
rest/{store_code}/V1/products/attributes/{attribute_code}
"options":[
{
"label":" ",
"value":""
},
{
"label":"Test Store",
"value":"4"
},
{
"label":"Test Store 1",
"value":"5"
},
{
"label":"Test Store 2",
"value":"6"
}
],
"is_user_defined":true,
"default_frontend_label":"Color",
"frontend_labels":[
{
"store_id":1,
"label":"Default Store View Lable"
},
{
"store_id":2,
"label":"Test Store View Lable"
}
],
Magento 2.2
rest/all/V1/products/attributes/{attribute_code}
"options":[
{
"label":" ",
"value":""
},
{
"label":"Black",
"value":"90"
},
{
"label":"Charcoal",
"value":"91"
},
{
"label":"Dark",
"value":"92"
},
{
"label":"Grey",
"value":"93"
},
{
"label":"Khaki",
"value":"94"
}
],
"is_user_defined":true,
"default_frontend_label":"Background color",
"frontend_labels":[
{
"store_id":1,
"label":"Default Store View"
},
{
"store_id":15,
"label":"Test Store View"
}
],
rest/{store_code}/V1/products/attributes/{attribute_code}
"options":[
{
"label":" ",
"value":""
},
{
"label":"neNeroro",
"value":"90"
},
{
"label":"Carbone",
"value":"91"
},
{
"label":"Buio",
"value":"92"
},
{
"label":"Grigio",
"value":"93"
},
{
"label":"Cachi",
"value":"94"
}
],
"is_user_defined":true,
"default_frontend_label":"Background color",
"frontend_labels":[
{
"store_id":1,
"label":"Default Store View"
},
{
"store_id":15,
"label":"Test Store View"
}
],
Hi @MaxSouza. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX label(s) to the ticket, indicating the components it may be related to.[ ] 2. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.
I'm working on it.
Hi,
In version 2.3 has already been fixed. Suggestion is to upgrade magento or use composer patches.
About magento support
https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html


Most helpful comment
if you use
/rest/all/V1... you can get the labels used on the admin view
To bad it is not documented how you use storeviews in the rest api.
/1/store/storeView says:
But to get admin you need to use all :-1: