1

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?

5

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/

  • Thanks...You are correct. But now I'm getting 'Consumer is not authorized to access %resources' error – SIBHI S Jan 2 '18 at 5:12
  • @SIBHIS - Yes because you need to pass Accesstoken with your url - something like Bearer youraccesstoken , then and then it will works – Manthan Dave Jan 2 '18 at 5:13
  • As i said follow this url - magento.stackexchange.com/questions/170921/… – Manthan Dave Jan 2 '18 at 5:15
  • Thanks a lot...it works. But index.php is not necessary in my case. – SIBHI S Jan 2 '18 at 5:20
  • @SIBHIS - Yes as i have written above index.php is optional , but rest is must parameter... Happy to help - Keep helping :) – Manthan Dave Jan 2 '18 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.