Jump to content

Webservice problem


g87

Recommended Posts

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 by g87 (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...