- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Magento 2.2.7 Rest API unaccessible in localhost
I am currently attempting to use REST API in Magento Community Edition 2.2.7. I pretty much followed the instruction on devdocs (https://devdocs.magento.com/guides/v2.3/rest/tutorials/orders/order-admin-token.html).
For authentication, I got Token and Secret for both Access and Client side from Admin panel, as <host>/rest/<store_code>/V1/integration/admin/token endpoint isn't working. PHP works perfectly fine.
However, when I try to access to API endpoint using Postman, it gives 404 Error, along with html of nginx status. Since I'm hitting 404, I don't think this is a permission issue but endpoint itself. I did take a look at Magento config file and Nginx config file, but there isn't really a change from original files. On the other hand, when I access localhost/swagger and use Access Token for API Key, it just gives me 500 Error.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2.2.7 Rest API unaccessible in localhost
Hi @ginny_lee
I would suggest you to pass index.php in the URL, so your URL should be like below :
http://your_host_name/index.php/rest/V1/integration/admin/token
Also to access the swagger you don't need to pass any token - after your host URL you just need to pass swagger and you will see the lists.
Hope it helps !
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2.2.7 Rest API unaccessible in localhost
Hello Manthan,
I already tried with index.php in the url, but it gave the same 404 result. Also, when I access http://localhost/swagger, it gives the same warning without any list:
- Failed to load API definition. Internal Server Error http://localhost/rest/all/scehma?services=all