g87 Posted November 21, 2014 Share Posted November 21, 2014 (edited) Hi, I would post a message after spending a few hours doing tests because I despair a little ... I have a website and a shop hosted on Plesk 11. The shop is located in the subdomain shop (https) and runs on 1.5.6.0 release. I want to use webservices for the principle that, from the website, I can retrieve the list of customers. I based on the doc found here: http://doc.prestashop.com/display/PS15/Using+the+PrestaShop+Web+Service and with the PDF http://doc.prestashop.com/download/attachments/327702/CRUD+Tutorial+FR.pdf (in French). Unfortunately, it does not work. The script returns me Bad ID. Here is the used code: define('DEBUG', true); define('PS_SHOP_PATH', 'http://shop.example.com'); define('PS_WS_AUTH_KEY', '######################'); require_once('./PSWebServiceLibrary.php'); // Here we make the WebService Call try { $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $opt['resource']='customers'; $xml = $webService->get($opt); $resources = $xml->children()->children(); } The Return HTTP Body is: RETURN HTTP BODY <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL /api/customers was not found on this server.</p> <hr> <address>Apache Server at shop.example.com Port 80</address> </body></html> I tried to use FastCGI but it always gave the same result. However, if I try to access the API directly from my browser (https://shop.example.com/api/customers), this works great! Have you ever encountered this kind of problem? Will has a configuration on Plesk to check? The CURL library is present. Thank you in advance for your help. Regards. G. Edited November 21, 2014 by g87 (see edit history) Link to comment Share on other sites More sharing options...
FullCircles Posted November 21, 2014 Share Posted November 21, 2014 If you're just using /api/customers as the path to the file, then it might not be able to find it due to it being on a subdomain Could try and give the full path from the server root, which could look something like /public_html/shop/api/customers 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