Dated_on can't be blank & due_date can't be blank

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!

Thanks

Jon Free

WasteSource

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.

“dated_on”: “2015-05-15T00:00:00.0000000”,
“due_on”: “2015-06-14T00:00:00.0000000”

These should be sent as a Date, eg:

“dated_on”: “2015-05-15”,
“due_on”: “2015-06-14”

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!

Thanks

Jon Free

WasteSource

Hi Jon,

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.

“dated_on”: “2015-05-15T00:00:00.0000000”,
“due_on”: “2015-06-14T00:00:00.0000000”

These should be sent as a Date, eg:

“dated_on”: “2015-05-15”,
“due_on”: “2015-06-14”

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!

Thanks

Jon Free

WasteSource


You received this message because you are subscribed to the Google Groups
“FreeAgent API” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to freeagent_api+unsubscribe@googlegroups.com.
To post to this group, send email to freeagent_api@googlegroups.com.
Visit this group at http://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.