Showing results for 
Search instead for 
Did you mean: 

Magento 2 Rest API Response Get Method 404 issue

Magento 2 Rest API Response Get Method 404 issue

I am trying to use magento2  Rest API method to generate the response for mobile APP.


For that created Following Structure:


Module:  Company/Manufacture


Company/Manufacture/registration.php  - Register Module

Company/Manufacture/etc/module.xml  -  To Enable Module


Company/Manufacture/API/CustomerInterface.php -  Following Code in this file:

namespace Company\Manufacture\Api;

interface CustomerInterface
public function customerlist();




Company/Manufacture/etc/webapi.xml:  Following code:


<?xml version="1.0"?>
<routes xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
   <route url="/V1/mobileapp/customer/customerlist" method="GET">
       <service class="Company\Manufacture\Api\CustomerInterface" method="customerlist"/>
        <resource ref="anonymous"/>


Company/Manufacture/Model/Customer.php: Following code:

namespace Company\Manufacture\Model;

use  Company\Manufacture\Api\CustomerInterface as ApiInterface;
class Customer implements ApiInterface {
public function customerlist(){
 $data =  array("Dance","Success");
        $test = array(['success'=>true,'data'=>$data);
        return $test;



Now after doing all these settings when running following url throws 404 error:

Not sure why getting 404 Error.  Am i missing any settings?   Do i need to configure anything on admin for this?


Is there any settings i need to do on admin to run REST API?


Any help would be appreciated.


Re: Magento 2 Rest API Response Get Method 404 issue

You should do next steps form make it work.

1) Add DI config with service definition

<preference for="Acme\RestApi\Api\HelloInterface" type="Acme\RestApi\Model\HelloService" />

2) Fix ACL definition



 <resource ref="anonymous"/>


      <resource ref="anonymous" />

3) Add DOC block for interface method (It is required for Reflection class)

interface HelloInterface
* Get Hello message
* @return string
public function sayHello();

4) Change your URL by this pattern:


In your case if your base url `` it must be something like this:

Here you can check full working example: link (30days only)