Running Magento V1.9 with Rest API

I can extract data using the REST api, but I need to exctract a list of categories and might even have the ability to add a new category through the API.

I have tried creating an module inside local and community folders, but I have this response returned.

exception 'Mage_Api2_Exception' with message 'Request does not match any route.'

QUESTION: Could it be caused by an error in my folder structure?

Inside api2.xml i think, theres must be a match between the route section and my call the API.

CALL: magentohosturl/api/rest/restapi/categories

Route section from api2.xml


Question: Is there something I might have overlooked that effects the route?

Full api2.xml file

<?xml version="1.0"?>
        <catalog translate="title" module="RestApi_Categories">
            <title>Category Rest API extension</title>
        <categories translate="title" module="RestApi_Categories">
            <title>Categories retrieval</title>
              <!--  <create>1</create>
                    <delete>1</delete>  --> 
            <attributes translate="entity_id name parent_id child_id is_active level position" module="RestApi_Categories">
                <entity_id>Category ID</entity_id>
                <parent_id>Category Parent ID</parent_id>
                <child_id>Category Child List</child_id>

QUESTION: How do I check wether the file is loaded or not?

Filepath: \app\code\community\RestApi\Categories\etc

Followed this guide to enable developer debug mode. http://www.blog.magepsycho.com/configuring-magento-for-development-debug-mode/

Routes from Api2 files is loaded here in function getRoutes($apiType): \app\code\core\Mage\Api2\Model\Config.php

Exception log contains an error message if my api2.xml is manpulated to fail.

Errors message is also present in returned answer from Magento API, so I can confirm my api2.xml is loaded and validates, but the contained routes inside, must be wrong.

Since I've found the routes function I should be able to debug what happens.

  • At a first glance, the routes look ok to me. are you sure your api2.xml is loaded? Or maybe it's not valid.
    – Marius
    Commented Aug 21, 2014 at 8:18
  • 1
    Here is how you can check if your file is loaded. Turn on the developer mode and make your xml not valid (remove a closing tag for example). If your file is loaded you should see an error on the screen.
    – Marius
    Commented Aug 21, 2014 at 10:59
  • Just come across a similar problem myself - in my case, looks like api2.xml is not loaded. Why would that be? I've installed my module on multiple sites before and this is the first time I've had this problem. I'm guessing it's to do with the fact this is the first site I've installed it on. Perhaps I need to raise a new question... Commented May 9, 2016 at 10:14

1 Answer 1


Route must look like this rest/api/categories and not just /categories

Now it's resources that fails, so I will provide a full copy, if I get there :)

Thanks Marius for input

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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