Looks like we have a random error on uploading Bills using the API. We
haven’t done anything and it looks like a similar problem as we had before
where you tightened up something at your end.
[FreeAgentException: StatusCode=422,
Response=RestSharp.RestResponse`1[FreeAgent.BillWrapper],
Content={“errors”:[{“message”:“dated_on can’t be
blank”},{“message”:“due_date can’t be blank”}]}]
I’m pretty sure dated_on is being set here. Due_date isn’t a field
that is referenced in your docs!
Could do with some answers pretty sharpish as my accounts department
now have a backlog of invoices that they can’t shift!
I’ve found your requests in our logs and by using them, have been able to
reproduce the issue you’ve reported.
It seems the problem is caused by your use of a DateTime when setting
dated_on and due_on in your requests, rather than a pure date.
I think you’re right, it’s possible one of our developers has tightened up
a validation on our models.
If you strip the timestamps from your request, you should be able to create
your bills successfully.
Hope this helps!
Dave JOn Wednesday, 27 May 2015 11:36:34 UTC+1, Jon Free wrote:
Hi,
Looks like we have a random error on uploading Bills using the API. We
haven’t done anything and it looks like a similar problem as we had before
where you tightened up something at your end.
[FreeAgentException: StatusCode=422, Response=RestSharp.RestResponse`1[FreeAgent.BillWrapper], Content={“errors”:[{“message”:“dated_on can’t be blank”},{“message”:“due_date can’t be blank”}]}]
I’m pretty sure dated_on is being set here. Due_date isn’t a field that is referenced in your docs!
Could do with some answers pretty sharpish as my accounts department now have a backlog of invoices that they can’t shift!
Just an update on this. It did indeed turn out to be validation tightening
which led to the problem you are seeing.
On further inspection it turns out our API docs actually show examples
using ISO 8601 timestamps for the date.
In light of this we have just reverted this change so you won’t need to
make any changes to your code.
Do be aware that we do discard the time part and always have done (since it
is actually a date field rather than time stamp)
Please accept our apologies for this.
Regards,
Nathan
Senior Operations Engineer
FreeAgentOn 27 May 2015 at 12:50, David Jones david.jones@freeagent.com wrote:
Hi Jon,
I’ve found your requests in our logs and by using them, have been able to
reproduce the issue you’ve reported.
It seems the problem is caused by your use of a DateTime when setting
dated_on and due_on in your requests, rather than a pure date.
I think you’re right, it’s possible one of our developers has tightened up
a validation on our models.
If you strip the timestamps from your request, you should be able to
create your bills successfully.
Hope this helps!
Dave J
On Wednesday, 27 May 2015 11:36:34 UTC+1, Jon Free wrote:
Hi,
Looks like we have a random error on uploading Bills using the API. We
haven’t done anything and it looks like a similar problem as we had before
where you tightened up something at your end.
[FreeAgentException: StatusCode=422, Response=RestSharp.RestResponse`1[FreeAgent.BillWrapper], Content={“errors”:[{“message”:“dated_on can’t be blank”},{“message”:“due_date can’t be blank”}]}]
I’m pretty sure dated_on is being set here. Due_date isn’t a field that is referenced in your docs!
Could do with some answers pretty sharpish as my accounts department now have a backlog of invoices that they can’t shift!