Magento 2 – Fix 404 Error in API Response

apimagento2rest api

I have to work with rest APIs in magento2. For that, I added Integration through backend system->Extensions->Integration and activated the same.

Then I tried to get a response of default API of

http://local.magento.com/V1/customers/1/billingAddres

But it gives 404 error always. Is anything I'm missing to set. I also added a new user and assigned a new role with all permissions How can I activate the rest API?

Best Answer

You have issue with your api url :

Your API URL should be like this - http://local.magento.com/index.php/rest/V1/customers/1/billingAddres

Where you must need to add index.php/rest before the api parameters.

index.php is optional BUT rest parameter is required in your url.

Fore more details refer this link - Magento 2 REST API usage with examples

Also for other parameters details refer this link - http://devdocs.magento.com/swagger/