0

I was looking for a way to get the category tree via ReST API.

I looked here but it doesn't seem to show how to fetch the category tree (it has an entry point which lists a product's assigned categories list, and that's not what I'm looking for).

I'm using Magento 1.6.2 (cannot update - even if it's possible, the guy before me working at this project killed a lot of kittens and considering the time I have to do this, and my newbieness, I cannot resurrect them) and I need to access ReST API (I already know how to do this in SOAP API). How can I create such custom entry point for ReST API? (It seems to not exist). I don't expect a long explanation. Links with their contexts are also accepted.

My intention is to use such API via a regular AJAX call:

$.get('entry/point', {data:needed, for:this, entry:point, function(categTree){
    //process (and build/display) the tree
}, 'json' /*or xml. actually don't care*/});
1

Not sure if this is exactly what you are looking for but you could look into how the admin site does this in Mage_Adminhtml_Catalog_CategoryController::categoriesJsonAction. I know that it is not part of the api but will return a json response of the category tree.

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.