cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Integration with API - route does not exist error

Magento 2 Integration with API - route does not exist error

I'm working on integrating linnworks with magento 2 using the rest endpoint which from what I gather is usually /rest/default/v1. However, when visiting that url in the browser, the following error is shown:

<response>
    <message>Request does not match any route.</message>
</response>

Usually, the response is (from a different magento 2 site with a working linnworks integration):

<response>
    <message>Specified request cannot be processed.</message>
</response>

So it looks like the rest endpoint may have been changed but I'm not sure where to find it. I've had a look in webapi.xml files but nothing has cropped up.

 

In the file \vendor\magento\magento2-base\lib\web\mage\webapi.js I have spotted the following: api: '/webapi/rest'. however, that appears to result in the same message.

 

Does anyone have any suggestions? Thanks in advance.

1 REPLY 1

Re: Magento 2 Integration with API - route does not exist error

The route implies the {URL} did not match, or there is issue with the Method Url.

<response>
    <message>Request does not match any route.</message>
</response>

It could also be the path of the API url itself is wrong or the Request Url Method is Incorrect, Like you are sending the GET method in POST request Calls.

 

Also when you hit the Get request urls on browser of any Magento 2 API mostly it requires the authentication.

GET : Url : http://192.168.0.101/magento/2.3.6/rest/all/V1/products
<response>
<message>
The consumer isn't authorized to access %resources.
</message>
</response>

Example: 
I am using my custom rest api for create orders 

http://192.168.0.101/magento/2.3.6/rest/V2/shopifyconnector/order/create

and the method of this URL is POST method.
POST Method Url example_1.png

 

But when I direct hit this URL in browser, it takes the GET method for this URL and the response is "Request does not match any route."

GET Method 

example.png
Hope it helps !
Problem Solved ? Click on 'Kudos' & Accept as Solution to encourage to write more answers !!
Thank you