wallink Posted March 20, 2011 Share Posted March 20, 2011 Hello.I have set up my prestashop 1.4 installation and everything works fine. I know want to use the webservice feature, but I can't get it to work.I have fixed all warnings and generated a key as well as enabled the different resources I want.If my shop is located at http://myurl/prestashop and that works as it should and I then goes to:http://myurl/prestashop/apiThen I only get 404 Not Found!What do I need to do? Link to comment Share on other sites More sharing options...
przemal Posted March 20, 2011 Share Posted March 20, 2011 Try accessing http://myurl/prestashop/0/webservice/dispatcher.php.If that'll work then you have a problem with URL rewriting. Firstly check if you have a .htaccess file in your PrestaShop root directory, if not generate it in the Back Office. 1 Link to comment Share on other sites More sharing options...
wallink Posted March 21, 2011 Author Share Posted March 21, 2011 If I go to http://myurl/prestashop/0/webservice/dispatcher.php I get 404 Not Found but when I go to http://myurl/prestashop/webservice/dispatcher.php, firefox asks me for username and password.When I try my admin login I just get the following response:<?xml version="1.0" encoding="UTF-8"?><![CDATA[internal error]]>1. What username and password?2. is it still url rewrites that doesn't work?thx Link to comment Share on other sites More sharing options...
przemal Posted March 21, 2011 Share Posted March 21, 2011 Sorry I meant http://myurl/prestashop/webservice/dispatcher.php, without 0, just forgot to remove it.Username is the key you've generated in the BackOffice and password is empty.Yes that still means you have a problem with URL rewriting. Link to comment Share on other sites More sharing options...
wallink Posted March 21, 2011 Author Share Posted March 21, 2011 ok, thanks.When I use that url I get a valid answer, but I can't us it to get any other resources.I have a .htaccess file, is there anything else that is needed for rewrites to work correctly? Link to comment Share on other sites More sharing options...
Chrille Posted April 3, 2011 Share Posted April 3, 2011 I have installed mod_rewrite:@a2enmod rewrite@@/etc/init.d/apache2 restart@But error.log does returns an error:@ File does not exist: /var/www/api@Any ideas why? Link to comment Share on other sites More sharing options...
mikih57 Posted April 3, 2011 Share Posted April 3, 2011 If I go to http://myurl/prestashop/0/webservice/dispatcher.php I get 404 Not Found but when I go to http://myurl/prestashop/webservice/dispatcher.php,'>http://myurl/prestashop/webservice/dispatcher.php, firefox asks me for username and password.When I try my admin login I just get the following response:<?xml version="1.0" encoding="UTF-8"?><![CDATA[internal error]]>1. What username and password?2. is it still url rewrites that doesn't work?thx Hello, When you active the webService (in the backoffice) an username is automaticaly generated. So, the username asked when you go on http://myurl/prestashop/webservice/dispatcher.php the username is the generated username. There are not password.if the urlRewriting is activated, the API adress is : http://myurl/prestashop/apibest regards, Mikael (Sorry for my English, I'm french .... anybody is perfect lol ) Link to comment Share on other sites More sharing options...
markp Posted August 4, 2013 Share Posted August 4, 2013 I have installed mod_rewrite: @a2enmod rewrite@ @/etc/init.d/apache2 restart@ But error.log does returns an error: @ File does not exist: /var/www/api@ Any ideas why? Make sure AllowOverride is enabled in the VirtualHost section for your website (/etc/apache2/sites-enabled/000-default on some systems). If it's set to None the .htaccess won't be able to enable rewrite: <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride ALL Order allow,deny allow from all </Directory> 1 Link to comment Share on other sites More sharing options...
haris b Posted June 3, 2014 Share Posted June 3, 2014 (edited) hello!! I am using prestashop 1.6 and I am trying to use the web service. At first I had the same problem as you did (error 404). then I used the url that you suggested above, that one with the dispatcher and as a result I got an xml tree, but the xlinks are not working as links, I mean I can not click on them. When I copy-paste them, then I get again an error 404... I think there is something to do with the api, I am not quite sure :/ Any thoughts or suggestions will be appreciated!! thank you in advance Edited June 3, 2014 by haris b (see edit history) Link to comment Share on other sites More sharing options...
yguerin Posted April 11, 2016 Share Posted April 11, 2016 (edited) Make sure AllowOverride is enabled in the VirtualHost section for your website (/etc/apache2/sites-enabled/000-default on some systems). If it's set to None the .htaccess won't be able to enable rewrite: <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride ALL Order allow,deny allow from all </Directory> Dear, You are right, I forgot this step and do service apache2 restart|reload Prestashop 1.6 Regards, Yves Edited April 11, 2016 by yguerin (see edit history) Link to comment Share on other sites More sharing options...
jesydeepu Posted February 25, 2017 Share Posted February 25, 2017 Pls try the following You need to pass the key like explained in our documentation as http://yourshop.com/api/?ws_key=YOUR_KEY Link to comment Share on other sites More sharing options...
acwd Posted March 9, 2017 Share Posted March 9, 2017 Hi, I spend 2 hours on this problem and I solved it by htaccess on the root directory. I saw that line alone : RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] I just add this before : RewriteCond %{HTTP_HOST} ^yoururl.com$ Now it works Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now