Category Custom Attribute in rest API in Magento 2












0















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.










share|improve this question





























    0















    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.










    share|improve this question



























      0












      0








      0








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 days ago









      magefms

      43113




      43113










      asked 2 days ago









      samsam

      125213




      125213






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You cannot change this structure on existing API.If you want to do this then you have to build custom API point.






          share|improve this answer
























          • 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











          • yes, you are right, they want like that only, so i have to restructure API

            – sam
            2 days ago











          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
          });


          }
          });














          draft saved

          draft discarded


















          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









          0














          You cannot change this structure on existing API.If you want to do this then you have to build custom API point.






          share|improve this answer
























          • 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











          • yes, you are right, they want like that only, so i have to restructure API

            – sam
            2 days ago
















          0














          You cannot change this structure on existing API.If you want to do this then you have to build custom API point.






          share|improve this answer
























          • 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











          • yes, you are right, they want like that only, so i have to restructure API

            – sam
            2 days ago














          0












          0








          0







          You cannot change this structure on existing API.If you want to do this then you have to build custom API point.






          share|improve this answer













          You cannot change this structure on existing API.If you want to do this then you have to build custom API point.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 days ago









          Amit BeraAmit 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 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, 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











          • 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


















          draft saved

          draft discarded




















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          An IMO inspired problem

          Management

          Has there ever been an instance of an active nuclear power plant within or near a war zone?