title: Custom Rest Api in Magento
body: <p>I need rest api to create customer in magneto for that I followed this tutorial <a href="http://www.authenticdesign.co.uk/extending-magento-rest-api-v2/" rel="noreferrer">http://www.authenticdesign.co.uk/extending-magento-rest-api-v2/</a></p>
  
  <p>I followed it step by step, But When I test the api on rest client it give me: <code>{"messages":{"error":[{"code":404,"message":"Request does not match any route."}]}}</code></p>
  
  <p>I do not have any idea where I am making mistake. Help me out here as I am very new to magento as well as for php.</p>
  
  <p>The steps are:</p>
  
  <p><strong>1. Enabled Extension at (app/etc/module/Custom_Restapi.xml)</strong></p>
  
  <pre><code>&lt;config&gt;
      &lt;modules&gt;
          &lt;Custom_Restapi&gt;
              &lt;active&gt;true&lt;/active&gt;
              &lt;codePool&gt;local&lt;/codePool&gt;
          &lt;/Custom_Restapi_Groups&gt;
      &lt;/modules&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p><strong>2. config.xml at (app/code/local/Custom/Restapi/etc/config.xml)</strong></p>
  
  <pre><code>   &lt;?xml version="1.0"?&gt;
  &lt;config&gt;
      &lt;modules&gt;
          &lt;Custom_Restapi&gt;
              &lt;version&gt;0.1.0.0&lt;/version&gt;
          &lt;/Custom_Restapi&gt;
      &lt;/modules&gt;
      &lt;global&gt;
          &lt;models&gt;
              &lt;restapi&gt;
                  &lt;class&gt;Custom_Restapi_Model&lt;/class&gt;
              &lt;/restapi&gt;
          &lt;/models&gt;
      &lt;/global&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p><strong>3. api2.xml at (app/code/local/Custom/Restapi/etc/api2.xml)</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;config&gt;
      &lt;api2&gt;
          &lt;resource_groups&gt;
              &lt;restapi translate="title" module="Custom_Restapi"&gt;
                  &lt;title&gt;Custom Rest API&lt;/title&gt;
                  &lt;sort_order&gt;10&lt;/sort_order&gt;
              &lt;/restapi&gt;
          &lt;/resource_groups&gt;
          &lt;resources&gt;
              &lt;restapi translate="title" module="Custom_Restapi"&gt;
                  &lt;group&gt;restapi&lt;/group&gt;
                  &lt;model&gt;restapi/api2_restapi&lt;/model&gt;
                  &lt;title&gt;Testing My Rest API&lt;/title&gt;
                  &lt;sort_order&gt;10&lt;/sort_order&gt;
                  &lt;privileges&gt;
                      &lt;admin&gt;
                          &lt;create&gt;1&lt;/create&gt;
                      &lt;/admin&gt;
                  &lt;/privileges&gt;
                  &lt;attributes  translate="" module="Custom_Restapi"&gt;
                      &lt;firstname&gt;First Name&lt;/firstname&gt;
                      &lt;lastname&gt;Last Name&lt;/lastname&gt;
                      &lt;email&gt;Email&lt;/email&gt;
                      &lt;password&gt;Password&lt;/password&gt;
                  &lt;/attributes&gt;
                 &lt;routes&gt;
                      &lt;route&gt;
                          &lt;route&gt;/customer&lt;/route&gt;
                          &lt;action_type&gt;collection&lt;/action_type&gt;
                      &lt;/route&gt;
                  &lt;/routes&gt;
                  &lt;versions&gt;1&lt;/versions&gt;
              &lt;/restapi&gt;
          &lt;/resources&gt;
      &lt;/api2&gt;
  &lt;/config&gt;
  </code></pre>
  
  <p><strong>4. Model Class Restapi.php at (app/code/local/Custom/Restapi/Model/Api2/Restapi.php)</strong></p>
  
  <pre><code>&lt;?php
  
  class Custom_Restapi_Model_Api2_Restapi extends Mage_Api2_Model_Resource
  {
  
  }
  
  ?&gt;
  </code></pre>
  
  <p><strong>5. V1.php at (app/code/local/Custom/Restapi/Model/Api2/Restapi/Rest/Admin/V1.php)</strong></p>
  
  <pre><code>&lt;?php
  class Custom_Restapi_Model_Api2_Restapi_Rest_Admin_V1 extends Custom_Restapi_Model_Api2_Restapi
  {
  
      /**
       * Create a customer
       * @return array
       */
  
      public function _create() {
  
          $requestData = $this-&gt;getRequest()-&gt;getBodyParams();
          $firstName = $requestData['firstname'];
          $lastName = $requestData['lastname'];
          $email = $requestData['email'];
          $password = $requestData['password'];
  
          $customer = Mage::getModel("customer/customer");
  
          $customer-&gt;setFirstname($firstName);
          $customer-&gt;setLastname($lastName);
          $customer-&gt;setEmail($email);
          $customer-&gt;setPasswordHash(md5($password));
          $customer-&gt;save();
  
         return  json_encode(array("testing","Success"));
     }
  
  }
  ?&gt;
  </code></pre>
  
  <p><strong>And my url is like : baseurl/api/rest/customer</strong></p>