Search code examples
magentomagento-rest-api

Magento REST is not Found after http://{magentoHost}/api/


I am trying to access rest API for Guest User through http://localhost/b_marketing/api/rest/products, but the page redirects to 404 page. I have checked retrive catalog products in ACL attributes RULES, REST - attributes and REST - ROLES, correctly. It also works correctly on my other project by using these all configurations.
There is one thing I need to mention here that my project works only when I use http://localhost/b_marketing/index.php , despite of setting up the htaccess rewrites and setting rewrite from admin panel. My apache rewrites are also set.
When I use http://localhost/b_marketing/api/?wsdl it works and some xml returns.
But I cannot use http://localhost/b_marketing/api/rest/products
The Response Header is always 404.


I also cannot access REST API using http://localhost/b_marketing/index.php/api/rest/products as well.


Solution

  • Make sure you have rewrite rule in .htaccess.

    1. Go to magento root folder, in your case it is b_marketing
    2. Open .htaccess file in any editor
    3. Locate rewrite rule for api

    If you don't have .htaccess file in place, you may consider to copy fron original Magento packagem