Jump to content

Webservices: is there any doc on this?


Recommended Posts

OK - I found it myself...

eg: activate products for GET ...

Then http://localhost/prestashop14/api/products

response is .... (Use Firebug to view the response)

<?xml version="1.0" encoding="UTF-8">












Then do ...

http://localhost/prestashop14/api/products/1


Response is ...

<?xml version="1.0" encoding="UTF-8"?>


<![CDATA[1]]>
<![CDATA[1]]>
<![CDATA[2]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[0]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[1]]>
<![CDATA[1]]>
<![CDATA[2]]>
<![CDATA[2]]>
<![CDATA[1]]>
<![CDATA[124.581940]]>

.........

very nice - I'm gonna play a little bit with this and keep you informed on this thread.

regards

Patrick De Laet

Link to comment
Share on other sites

We really need some doc on the Webservices API Request and Response.

http://localhost/prestashop14/api/customers/1

returns ... which is OK

<?xml version="1.0" encoding="UTF-8"?>


<![CDATA[1]]>
<![CDATA[1]]>
<![CDATA[1970-01-15]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[2010-12-09 20:51:51]]>
<![CDATA[0]]>
<![CDATA[DOE]]>
<![CDATA[ad807bdf0426766c05c64041124d30ce]]>
<![CDATA[John]]>
<![CDATA[[email protected]]]>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[47ce86627c1f3c792a80773c5d2deaf8]]>
<![CDATA[1]]>
<![CDATA[1]]>
<![CDATA[1]]>
<![CDATA[1]]>



But calling ...

http://localhost/prestashop14/api/customers/123456

returns ... nothing!

Why doesn't the API returns an errorcode and an error as response?
eg '123-Unknown customer'

regards

Patrick De laet

Link to comment
Share on other sites

  • 1 month later...
....

But calling ...

http://localhost/prestashop14/api/customers/123456

returns ... nothing!

Why doesn't the API returns an errorcode and an error as response?
eg '123-Unknown customer'

regards

Patrick De laet


The API uses HTTP error codes. Just tested it and got an error 404 (not found) which is quite correct. Check out the response headers you get from the server :)
Link to comment
Share on other sites

  • 2 weeks later...

I make some testing too. I'm thinking that POST request is not working at all. GET, HEAD, PUT and DELETE works well but if I'm trying a POST request, e.g

http://localhost/api/manufacturers


and I'm sending text/xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>


<![CDATA[3]]>
<![CDATA[3]]>
<link_rewrite><![CDATA[apple-computer-inc]]></link_rewrite>
<![CDATA[Apple Computer, Inc]]>

<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>

<meta_title>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>
</meta_title>
<meta_description>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>
</meta_description>

<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>

<meta_keywords>
<![CDATA[]]>
<![CDATA[]]>
<![CDATA[]]>
</meta_keywords>




It fires me with 500 and no response, even if I setted error outputs on (seeing other errors correctly). I tried to remove and , to remove content of theese with no succes :)

How to make it right?

Link to comment
Share on other sites

  • 3 weeks later...

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...