Latest From The Blog

Service announcements and product updates from the Mad Capsule team

Mark

Brightpearl API Error ( CMNC-009 )

January 28th, 2013 by Mark in php

Ok so after having a couple of debug issues with a PHP script that was calling on the Brightpearl API, one of our guys was continually getting :

[code] => CMNC-009 [message] => The request body could not be read while attempting to parse it as JSON

nyhow after overlooking something really obvious for far too long, it was realised that it was being caused by double encoding json encoding.

So the postdata was being encoded then sent to a controller which was encoding the postdata into json ! Anyhow a real simple one, but something that was easy to over look, hopefully this will save somebody some time if they get the same issue, just dump your postdata json data just before it is used in your API call and check it matches the required structure.

comments powered by Disqus

OUR AUTHORS

Mark
Mark

I like the Sea, Monkeys, the Internet and sun. I don't like olives

James
James

Less QQ more pew pew

Israel
Israel

I love time travel, infact I'm writing this from the 1920s

CATEGORIES