0

I am trying to get only the category name and category id with the parent and child segregation programmatically using REST API. Can anyone please suggest some solution or provide some sample code which would help me achieve the task.

Thanks in advance

1

To get the name and ID of te categgory you need to call below rest API:

local.magento2.3.1.com/rest//V1/categories/2

using GET method to get details of the category and all its child. If you want parent and child segregation then you need to write down a module with webapi.xml file and declare your endpoint and method in it. In that method you need to write down the code to fetch all details separately. Let me know if this suggestion helps or you want me to write down the code to provide you.

Thanks

Rahul Anand

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.