# API update: Graceful handling of malformed data

**URL:** <https://api-discuss.freeagent.com/t/api-update-graceful-handling-of-malformed-data/14>\
**Category:** Uncategorized\
**Created:** [12 April 2013 13:24 UTC](https://api-discuss.freeagent.com/t/api-update-graceful-handling-of-malformed-data/14 "2013-04-12T13:24:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ioan\_Serban](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/ioan_serban/32/148_2.png) [@Ioan\_Serban](https://api-discuss.freeagent.com/u/Ioan_Serban)\
**Post date:** [12 April 2013 13:24 UTC](https://api-discuss.freeagent.com/t/api-update-graceful-handling-of-malformed-data/14/1 "2013-04-12T13:24:02Z")

</div>

Hi there,

Today we made a change to the API so it deals more gracefully with  
malformed data sent to it. Instead of a HTTP 500 Internal Server Error you  
will now receive a 400 Bad Request along with the following JSON/XML,  
depending on the type of data you are posting:

{“error”:“Invalid JSON”}

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

> Invalid XML

In this case you can use a JSON/XML validator like JSONLint[http://jsonlint.com/](http://jsonlint.com/)or W3C’s  
XML validator [http://www.w3.org/2001/03/webdata/xsv](http://www.w3.org/2001/03/webdata/xsv) to check your syntax  
for errors.

Best regards,  
Ioan
