I.T. Security and Linux Administration

Mar 31 2013   1:45PM GMT

Online Carts – API

Eric Hansen Eric Hansen Profile: Eric Hansen

I couldn’t wait to write this section.  The API is both a blessing and a damn curse rolled into one.

First thing, the API works by parsing XML both in and out.  So, you poll the API service to retrieve a XML structure of data that you then manipulate and send back.  Not a horrible idea, in theory.

I’ve never been a fan of XML for this purpose to begin with, but I’m not biased in this review either.  Getting the data is a piece of cake.  The problem comes in trying to figure out what you need to edit and what you have to take out.  It doesn’t do it for you, its nothing but trial and error.  Now, this wouldn’t really be a complaint IF the documentation would tell you.  But the documentation for the API is just as vague.

Probably my biggest gripe, is the API helper they give you for PHP doesn’t technically support the newest versions of PrestaShop.  You have to edit a line to tell it to support version (which is the most recent at the time of writing).

Not only that, but as I said, the API is nothing but trial and error.  I spent a good 4-5 hours trying to figure out why I couldn’t insert a product.  Even when I enabled debugging/dev mode, the responses were nothing but “Error: 400.  This means a bad request.”  Okay?  What bad request?  Nothing in the error logs, nothing else spit out, closest thing I knew is it had to deal with line 214 in the API helper script.  Yeah, not great.

Then, I kept getting an error stating bad parameters given.  Apparently, there’s some fields that, even though it gives you in the XML, you have to remove yourself.  Not very intuitive, and if it wasn’t for it had everything I wanted and I didn’t like the other solutions, I would’ve ditched it.

It gets better, and worse, though at the same time.  Right now I still haven’t figured out how to properly add a new image to a product, but I’ll figure that out after Easter.

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: