frankhe Posted November 15, 2012 Share Posted November 15, 2012 I just downloaded latest version v1.5.2 based on the developer guide, the api url is: http://myprestashop.com/api/ But is that working? I checked the source code, there is NO api directory at all. when I use my url: http://dev.prestashop.com/api, I got 404 error. I suspect this version download is not complete. Please give some advice. 1 Link to comment Share on other sites More sharing options...
alexjv89 Posted December 6, 2012 Share Posted December 6, 2012 same problem here .. . Link to comment Share on other sites More sharing options...
alexjv89 Posted December 8, 2012 Share Posted December 8, 2012 (edited) I guess .. I figured it out ... For some reason the api folder is designed to not exist. I am guessing its for security reasons. Instead using the .htaccess file, the url is redirected to webservices subfolder in your store specifically to dispatcher.php in that folder. This is where the actual code for webservice exists. Atleast the dispatching part of the code. So dont worry API folder does not exist. Now to solve this problem. I figured out what was happening when the same files was working on one hosting provider and not on another. webservices for 1.5.2 was working on site5 hosting but not on hostgator and my localhost. I had 2 issues. you problem could be one of these or both. Firstly your hosting should enable mod_rewrite. You will have to contact your hosting provider to enable that. On localhost you will have to set it in your php apache. I had this problem on the hostgator account. I did this and it started working On my localhost, I checked and found out that mod_rewrite was enabled but I still cannot access webservice. I am using lampp on ubuntu 12.04. All the command for url rewriting is chalked out in a file called .htaccess in your store main folder. This file was missing on my localhost store folder. This was because ubuntu was not allowing prestashop to create or modify this file. So what I did was create a blank .htacess file and using chmod set the permissions of that file to 666. In prestashop 1.4 .htaccess can be manually generated. In prestashop 1.5 it is automatically generated. But you need to trigger prestashop to update the .htaccess file. So what I did was go to preference and enable friendly url. saved settings and then disabled friendly url. Now when I check back at the .htaccess file it is no longer blank, prestashop has written something in it. I checked webservices and it worked. Hope this was useful ... Edited December 8, 2012 by alexjv89 (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts