API - unhelpful errors when modifying contact
I'm experimenting with the API - obviously when you're trying to find your way around is when error responses can really be of help.
So, if I post the following incorrect XML to https://myco.freeagentcentral.com/con...
<?xml version="1.0" encoding="UTF-8"?>
<contact>
<organisation>Blah</organisation>
<first-name>Blah</first-name>
<last-name>Blah</last-name>
<phone-number>Blah</phone-number>
</contact>
I get the following back:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
</errors>
Which is a little terse :-)
Maybe something like
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Unknown field organisation</error>
</errors>
would be more helpful?
So, if I post the following incorrect XML to https://myco.freeagentcentral.com/con...
<?xml version="1.0" encoding="UTF-8"?>
<contact>
<organisation>Blah</organisation>
<first-name>Blah</first-name>
<last-name>Blah</last-name>
<phone-number>Blah</phone-number>
</contact>
I get the following back:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
</errors>
Which is a little terse :-)
Maybe something like
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Unknown field organisation</error>
</errors>
would be more helpful?
1
person has this problem
I have this problem, too!
Tell me when someone solves it.
The more people who report this problem, the more it gets noticed.
The more people who report this problem, the more it gets noticed.
The company has a solution in progress.
-
Inappropriate?Hi Andy,
Thanks for this. Errors should be returned in the way your suggest, but in the case of an invalid field name it seems like we're not handling the error gracefully.
For example, if you POST the following:
<?xml version="1.0" encoding="UTF-8"?>
<contact>
<first-name>Blah</first-name>
<phone-number>Blah</phone-number>
</contact>
You will get back the response:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Last name can't be blank</error>
</errors>
In the case of submitting an invalid request as in your example, it looks like we're not returning an HTTP 400 response, which should be the right response. We'll ensure this is changed.
Loading Profile...



