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
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?
2 Answers 2
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' errorSIBHI S– SIBHI S2018年01月02日 05:12:28 +00:00Commented Jan 2, 2018 at 5:12
- 
 @SIBHIS - Yes because you need to pass Accesstoken with your url - something like Bearer youraccesstoken , then and then it will worksManthan Dave– Manthan Dave2018年01月02日 05:13:05 +00:00Commented Jan 2, 2018 at 5:13
- 
 As i said follow this url - magento.stackexchange.com/questions/170921/…Manthan Dave– Manthan Dave2018年01月02日 05:15:03 +00:00Commented Jan 2, 2018 at 5:15
- 
 Thanks a lot...it works. But index.php is not necessary in my case.SIBHI S– SIBHI S2018年01月02日 05:20:18 +00:00Commented Jan 2, 2018 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– Manthan Dave2018年01月02日 05:25:10 +00:00Commented Jan 2, 2018 at 5:25
Yes, I was facing the same issue on the dev server and I just add the index.php before /rest/v1 and the issue get resolved.
Thank you!!