Category Custom Attribute in rest API in Magento 2
I am using magento 2.2.7 and I am creating rest API for Category. From swagger I am getting value like:
{
"id": 28,
"parent_id": 2,
"name": "Smart Phones",
"is_active": true,
"position": 1,
"level": 2,
"children": "",
"created_at": "2018-11-03 01:32:45",
"updated_at": "2019-01-14 06:33:52",
"path": "1/2/28",
"available_sort_by": ,
"include_in_menu": true,
"custom_attributes": [
{
"attribute_code": "display_mode",
"value": "PRODUCTS"
},
{
"attribute_code": "is_anchor",
"value": "1"
},
{
"attribute_code": "path",
"value": "1/2/28"
},
{
"attribute_code": "children_count",
"value": "0"
},
{
"attribute_code": "custom_use_parent_settings",
"value": "0"
},
{
"attribute_code": "custom_apply_to_products",
"value": "0"
},
{
"attribute_code": "url_key",
"value": "smart-phones"
},
{
"attribute_code": "url_path",
"value": "smart-phones"
},
{
"attribute_code": "tamil",
"value": "பேக்குகள் & லக்கேஜ்"
},
{
"attribute_code": "telugu",
"value": "బ్యాగ్స్ & లగేజీ"
}
]
}
In which "attribute_code":
"telugu"
, and "attribute_code":
"tamil"
, is custom attribute
. and it is coming inside the custom Attribute array
.
I want this parameter outside of custom attribute along with NAME and ID.
Please help me to achieve this.
magento2 category rest-api
add a comment |
I am using magento 2.2.7 and I am creating rest API for Category. From swagger I am getting value like:
{
"id": 28,
"parent_id": 2,
"name": "Smart Phones",
"is_active": true,
"position": 1,
"level": 2,
"children": "",
"created_at": "2018-11-03 01:32:45",
"updated_at": "2019-01-14 06:33:52",
"path": "1/2/28",
"available_sort_by": ,
"include_in_menu": true,
"custom_attributes": [
{
"attribute_code": "display_mode",
"value": "PRODUCTS"
},
{
"attribute_code": "is_anchor",
"value": "1"
},
{
"attribute_code": "path",
"value": "1/2/28"
},
{
"attribute_code": "children_count",
"value": "0"
},
{
"attribute_code": "custom_use_parent_settings",
"value": "0"
},
{
"attribute_code": "custom_apply_to_products",
"value": "0"
},
{
"attribute_code": "url_key",
"value": "smart-phones"
},
{
"attribute_code": "url_path",
"value": "smart-phones"
},
{
"attribute_code": "tamil",
"value": "பேக்குகள் & லக்கேஜ்"
},
{
"attribute_code": "telugu",
"value": "బ్యాగ్స్ & లగేజీ"
}
]
}
In which "attribute_code":
"telugu"
, and "attribute_code":
"tamil"
, is custom attribute
. and it is coming inside the custom Attribute array
.
I want this parameter outside of custom attribute along with NAME and ID.
Please help me to achieve this.
magento2 category rest-api
add a comment |
I am using magento 2.2.7 and I am creating rest API for Category. From swagger I am getting value like:
{
"id": 28,
"parent_id": 2,
"name": "Smart Phones",
"is_active": true,
"position": 1,
"level": 2,
"children": "",
"created_at": "2018-11-03 01:32:45",
"updated_at": "2019-01-14 06:33:52",
"path": "1/2/28",
"available_sort_by": ,
"include_in_menu": true,
"custom_attributes": [
{
"attribute_code": "display_mode",
"value": "PRODUCTS"
},
{
"attribute_code": "is_anchor",
"value": "1"
},
{
"attribute_code": "path",
"value": "1/2/28"
},
{
"attribute_code": "children_count",
"value": "0"
},
{
"attribute_code": "custom_use_parent_settings",
"value": "0"
},
{
"attribute_code": "custom_apply_to_products",
"value": "0"
},
{
"attribute_code": "url_key",
"value": "smart-phones"
},
{
"attribute_code": "url_path",
"value": "smart-phones"
},
{
"attribute_code": "tamil",
"value": "பேக்குகள் & லக்கேஜ்"
},
{
"attribute_code": "telugu",
"value": "బ్యాగ్స్ & లగేజీ"
}
]
}
In which "attribute_code":
"telugu"
, and "attribute_code":
"tamil"
, is custom attribute
. and it is coming inside the custom Attribute array
.
I want this parameter outside of custom attribute along with NAME and ID.
Please help me to achieve this.
magento2 category rest-api
I am using magento 2.2.7 and I am creating rest API for Category. From swagger I am getting value like:
{
"id": 28,
"parent_id": 2,
"name": "Smart Phones",
"is_active": true,
"position": 1,
"level": 2,
"children": "",
"created_at": "2018-11-03 01:32:45",
"updated_at": "2019-01-14 06:33:52",
"path": "1/2/28",
"available_sort_by": ,
"include_in_menu": true,
"custom_attributes": [
{
"attribute_code": "display_mode",
"value": "PRODUCTS"
},
{
"attribute_code": "is_anchor",
"value": "1"
},
{
"attribute_code": "path",
"value": "1/2/28"
},
{
"attribute_code": "children_count",
"value": "0"
},
{
"attribute_code": "custom_use_parent_settings",
"value": "0"
},
{
"attribute_code": "custom_apply_to_products",
"value": "0"
},
{
"attribute_code": "url_key",
"value": "smart-phones"
},
{
"attribute_code": "url_path",
"value": "smart-phones"
},
{
"attribute_code": "tamil",
"value": "பேக்குகள் & லக்கேஜ்"
},
{
"attribute_code": "telugu",
"value": "బ్యాగ్స్ & లగేజీ"
}
]
}
In which "attribute_code":
"telugu"
, and "attribute_code":
"tamil"
, is custom attribute
. and it is coming inside the custom Attribute array
.
I want this parameter outside of custom attribute along with NAME and ID.
Please help me to achieve this.
magento2 category rest-api
magento2 category rest-api
edited 2 days ago
magefms
43113
43113
asked 2 days ago
samsam
125213
125213
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You cannot change this structure on existing API.If you want to do this then you have to build custom API point.
yes, in custom API only, how to achieve this?
– sam
2 days ago
Why you don't want to fetch data fromcustom Attribute array
.? As per as Magento standard very custom data and third party related data should be inside ofcustom_attributes
andextension_attribute
.I guess that your app developer tell you to provide d?ata in this way!!!! Why they donot fetch data from inside fromcustom Attribute array
– Amit Bera♦
2 days ago
yes, you are right, they want like that only, so i have to restructure API
– sam
2 days ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257660%2fcategory-custom-attribute-in-rest-api-in-magento-2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You cannot change this structure on existing API.If you want to do this then you have to build custom API point.
yes, in custom API only, how to achieve this?
– sam
2 days ago
Why you don't want to fetch data fromcustom Attribute array
.? As per as Magento standard very custom data and third party related data should be inside ofcustom_attributes
andextension_attribute
.I guess that your app developer tell you to provide d?ata in this way!!!! Why they donot fetch data from inside fromcustom Attribute array
– Amit Bera♦
2 days ago
yes, you are right, they want like that only, so i have to restructure API
– sam
2 days ago
add a comment |
You cannot change this structure on existing API.If you want to do this then you have to build custom API point.
yes, in custom API only, how to achieve this?
– sam
2 days ago
Why you don't want to fetch data fromcustom Attribute array
.? As per as Magento standard very custom data and third party related data should be inside ofcustom_attributes
andextension_attribute
.I guess that your app developer tell you to provide d?ata in this way!!!! Why they donot fetch data from inside fromcustom Attribute array
– Amit Bera♦
2 days ago
yes, you are right, they want like that only, so i have to restructure API
– sam
2 days ago
add a comment |
You cannot change this structure on existing API.If you want to do this then you have to build custom API point.
You cannot change this structure on existing API.If you want to do this then you have to build custom API point.
answered 2 days ago
Amit Bera♦Amit Bera
57.4k1474171
57.4k1474171
yes, in custom API only, how to achieve this?
– sam
2 days ago
Why you don't want to fetch data fromcustom Attribute array
.? As per as Magento standard very custom data and third party related data should be inside ofcustom_attributes
andextension_attribute
.I guess that your app developer tell you to provide d?ata in this way!!!! Why they donot fetch data from inside fromcustom Attribute array
– Amit Bera♦
2 days ago
yes, you are right, they want like that only, so i have to restructure API
– sam
2 days ago
add a comment |
yes, in custom API only, how to achieve this?
– sam
2 days ago
Why you don't want to fetch data fromcustom Attribute array
.? As per as Magento standard very custom data and third party related data should be inside ofcustom_attributes
andextension_attribute
.I guess that your app developer tell you to provide d?ata in this way!!!! Why they donot fetch data from inside fromcustom Attribute array
– Amit Bera♦
2 days ago
yes, you are right, they want like that only, so i have to restructure API
– sam
2 days ago
yes, in custom API only, how to achieve this?
– sam
2 days ago
yes, in custom API only, how to achieve this?
– sam
2 days ago
Why you don't want to fetch data from
custom Attribute array
.? As per as Magento standard very custom data and third party related data should be inside of custom_attributes
and extension_attribute
.I guess that your app developer tell you to provide d?ata in this way!!!! Why they donot fetch data from inside from custom Attribute array
– Amit Bera♦
2 days ago
Why you don't want to fetch data from
custom Attribute array
.? As per as Magento standard very custom data and third party related data should be inside of custom_attributes
and extension_attribute
.I guess that your app developer tell you to provide d?ata in this way!!!! Why they donot fetch data from inside from custom Attribute array
– Amit Bera♦
2 days ago
yes, you are right, they want like that only, so i have to restructure API
– sam
2 days ago
yes, you are right, they want like that only, so i have to restructure API
– sam
2 days ago
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257660%2fcategory-custom-attribute-in-rest-api-in-magento-2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown