Welcome to Discussion Forum, where you can ask questions and receive answers from other members of the community.

I am not able to access api URL in Prestashop - 404 error. What should I do??

0 like 0 dislike
I am very disappointed as I am not able to access my Webservice in my site that is running with Prestashop 1.6 version. Due to this I am not able to connect with one of the major Prestashop ship module. In short when I access https://example.com/api it is redirecting to 404 page.
 
Can anyone help me to sort out this issue?
asked Feb 22, 2017 in Prestashop by harsh (8,710 points)

2 Answers

1 like 0 dislike

To use prestashop api following things should be done:

1. Enable prestashop webservie : Go at Advance Parameters  > Webservice and enable prestashop webservice.

2. Add a key: After enabling the webservice add a key and select the resource which you want and give the desired permission to that resource.

 

The endpoint to your store's webservice is located in the /api/ folder at the root of your installation of Prestashop:

To access it, you need to provide your API key when request. There is no password, providing your API key is enough – and therefore the key should be kept secret by the user!

You can either type the API endpoint address directly then enter your API key, or indicate your API key in the address. Here is an example, with "UCCLLQ9N2ARSHWCXLT74KUKSSK34BFKX" being the API key.

 

For more help you can view the prestashop webservice documentation.

answered Feb 22, 2017 by amathur (900 points)
0 like 0 dislike
Please check if you have enabled the PrestaShop's web service from your admin panel. It should be enabled in order to make the web service properly.
 
Check here:- Advanced Parameters -> Webservice -> Enable PrestaShop's webservice
 
In case it is enabled you should check the .htaccess file in your PrestaShop's root directory, it should contain the following lines in order to make the Webservice API work properly.
 
RewriteRule ^api$ api/ [L]
 
RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
answered Feb 25, 2017 by harsh (8,710 points)

Related questions

0 like 0 dislike
0 answers 191 views
0 like 0 dislike
0 answers 47 views
47 views asked Apr 5, 2017 in Prestashop by harsh (8,710 points)
0 like 0 dislike
0 answers 53 views
0 like 0 dislike
0 answers 313 views
0 like 0 dislike
1 answer 1,898 views
1,898 views asked Feb 24, 2017 in Prestashop by harsh (8,710 points)
...