Create Mileage API not working

Hi

It s working before but not any more

The XML that I am sending is stored in an XML file:

<expense>

  <user>https://api.irisopenbooks.co.uk/v2/users/205154</user>

  <category>https://api.irisopenbooks.co.uk/v2/categories/249</category>

  <dated-on type="date">2015-12-13</dated-on>

  <mileage type="decimal">220.00</mileage>

  <description>test mileage</description>

  <vehicle-type>Car</vehicle-type>

  <reclaim_mileage_rate>0.4</reclaim_mileage_rate>

  <rebill_mileage_rate>0.4</rebill_mileage_rate>

I am using google auth play:

I created a token and added two headers

  • ‘Accept’ with value ‘application/xml’
  • and ‘Content-Type’ with value ‘application/xml’

and I I tried posting it using thr following URL

Before posting I ma setting the content type on the google auth play user
interface to: application/xml’

But it is coming with 500 error

HTTP/1.1 500 Internal Server Error

X-request-id: e3e817af-cfb7-4876-8914-6b5c736c315d

X-xss-protection: 1; mode=block

X-rev: 8577aa

X-content-type-options: nosniff

Transfer-encoding: chunked

Set-cookie: uid=bUl+XlZvEghbLwhQDrylAg==; expires=Tue, 13-Dec-16 19:01:28 GMT; domain=.freeagent.com; path=/

Vary: Origin

X-runtime: 0.031940

Server: nginx

Connection: keep-alive

X-frame-options: SAMEORIGIN

Content-type: application/xml

X-host: web2-gc

This xml was working last time I tried in April this year.

Please help.

Pankaj

Hi David

Just ignore all my messages.
I am using DOT NET and my HHTPResponse object was not getting disposed
correctly and hence it was timing out in 3rd attempt. I am now using the
‘using’ key word (see below) and all works fine.

                // Send the request to Free Agent

                using (StreamWriter streamOut = new StreamWriter

(req.GetRequestStream()))

                {

                    streamOut.Write(request);

                    streamOut.Close();


                    // and get the response

                    using (WebResponse resp = req.GetResponse())

                    {

                        newID = ExtractID(resp, URL);

                    }

                }

Thanks
PankajOn Wednesday, 16 December 2015 00:16:43 UTC, Pankaj Jain wrote:

Doing a little more digging, it appears as if the timeout happens after
every 2 successful HTTP POST.
Do I need to add some delay between the HTTP POST request?
Thanks
Pankaj

On Tuesday, 15 December 2015 20:25:43 UTC, Pankaj Jain wrote:

Hi David

Sorry to bother again. While your mentioned solution fixed the problem, I
am now getting timeout, almost every 2nd/3rd transaction I am submitting.
The same app worked flawlessly last time. Is there any bottleneck on the
isiropenbook server at the moment? This is quite frustrating as I need to
upload transactions from April 2015 onwards.

Also I noticed that the type=date was used in generating XML for
expenses, mileage, invoices and bank transactions. While apart from mileage
all other works, do you think it is a good idea to remove that from all
others as this is more correct behaviour or this is a temp glitch in the
code and will be fixed in the future release, so I limit my changes to just
mileage type.

Thanks in advance
Pankaj

On Tuesday, 15 December 2015 12:59:10 UTC, Pankaj Jain wrote:

Hi David

Thanks for the reply.
I just tried your suggestion through Google OAuth Playground and now it
works.

Its strange that the API behavior have changed between march 2015 and
now as the XML were working file before and I have been scratching my head
over the weekend as why it has stopped working. I couldn’t figure out as I
made some changes to my batch uploaded app as well.

Anyway all sorted.
Cheers
Pankaj

On Tuesday, 15 December 2015 12:05:54 UTC, David Jones wrote:

Hi Pankaj,

Thank you for your message and I’m sorry to hear you’re having trouble,
I’m sure I can help.

I’ve investigated this issue with my colleague and using the XML you’ve
provided, we’ve been able to reproduce the issue.

FreeAgent expects that date values will be sent as a string, for
example “2015-12-13”, which we then convert into a Date.
In the XML you’ve provided, you’ve explicitly set the type=“date”
attribute which means the conversion isn’t required.

We need to make a change in our API to skip the conversion if a date
has already been supplied.
For now, you should be able to fix your integration by removing the type=“date”
attribute from dated-on element in your request:

  <dated-on>2015-12-13</dated-on>

Our apologies for the confusion and I hope this helps!

Kind regards,
Dave J

On 14 December 2015 at 19:17, Pankaj Jain jai...@gmail.com wrote:

Hi

It s working before but not any more

The XML that I am sending is stored in an XML file:

<expense>

  <user>https://api.irisopenbooks.co.uk/v2/users/205154</user>

  <category>https://api.irisopenbooks.co.uk/v2/categories/249</

category>

  <dated-on type="date">2015-12-13</dated-on>

  <mileage type="decimal">220.00</mileage>

  <description>test mileage</description>

  <vehicle-type>Car</vehicle-type>

  <reclaim_mileage_rate>0.4</reclaim_mileage_rate>

  <rebill_mileage_rate>0.4</rebill_mileage_rate>

I am using google auth play:

I created a token and added two headers

  • ‘Accept’ with value ‘application/xml’
  • and ‘Content-Type’ with value ‘application/xml’

and I I tried posting it using thr following URL

Before posting I ma setting the content type on the google auth play
user interface to: application/xml’

But it is coming with 500 error

HTTP/1.1 500 Internal Server Error

X-request-id: e3e817af-cfb7-4876-8914-6b5c736c315d

X-xss-protection: 1; mode=block

X-rev: 8577aa

X-content-type-options: nosniff

Transfer-encoding: chunked

Set-cookie: uid=bUl+XlZvEghbLwhQDrylAg==; expires=Tue, 13-Dec-16 19:01:28 GMT; domain=.freeagent.com; path=/

Vary: Origin

X-runtime: 0.031940

Server: nginx

Connection: keep-alive

Date: Mon, 14 Dec 2015 19:01:28 GMT

X-frame-options: SAMEORIGIN

Content-type: application/xml

X-host: web2-gc

This xml was working last time I tried in April this year.

Please help.

Pankaj


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_ap...@googlegroups.com.
To post to this group, send email to freeag...@googlegroups.com.
Visit this group at https://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.


David Jones
Senior Support Engineer

FreeAgent

Doing a little more digging, it appears as if the timeout happens after
every 2 successful HTTP POST.
Do I need to add some delay between the HTTP POST request?
Thanks
PankajOn Tuesday, 15 December 2015 20:25:43 UTC, Pankaj Jain wrote:

Hi David

Sorry to bother again. While your mentioned solution fixed the problem, I
am now getting timeout, almost every 2nd/3rd transaction I am submitting.
The same app worked flawlessly last time. Is there any bottleneck on the
isiropenbook server at the moment? This is quite frustrating as I need to
upload transactions from April 2015 onwards.

Also I noticed that the type=date was used in generating XML for expenses,
mileage, invoices and bank transactions. While apart from mileage all other
works, do you think it is a good idea to remove that from all others as
this is more correct behaviour or this is a temp glitch in the code and
will be fixed in the future release, so I limit my changes to just mileage
type.

Thanks in advance
Pankaj

On Tuesday, 15 December 2015 12:59:10 UTC, Pankaj Jain wrote:

Hi David

Thanks for the reply.
I just tried your suggestion through Google OAuth Playground and now it
works.

Its strange that the API behavior have changed between march 2015 and now
as the XML were working file before and I have been scratching my head over
the weekend as why it has stopped working. I couldn’t figure out as I made
some changes to my batch uploaded app as well.

Anyway all sorted.
Cheers
Pankaj

On Tuesday, 15 December 2015 12:05:54 UTC, David Jones wrote:

Hi Pankaj,

Thank you for your message and I’m sorry to hear you’re having trouble,
I’m sure I can help.

I’ve investigated this issue with my colleague and using the XML you’ve
provided, we’ve been able to reproduce the issue.

FreeAgent expects that date values will be sent as a string, for example
“2015-12-13”, which we then convert into a Date.
In the XML you’ve provided, you’ve explicitly set the type=“date”
attribute which means the conversion isn’t required.

We need to make a change in our API to skip the conversion if a date has
already been supplied.
For now, you should be able to fix your integration by removing the type=“date”
attribute from dated-on element in your request:

  <dated-on>2015-12-13</dated-on>

Our apologies for the confusion and I hope this helps!

Kind regards,
Dave J

On 14 December 2015 at 19:17, Pankaj Jain jai...@gmail.com wrote:

Hi

It s working before but not any more

The XML that I am sending is stored in an XML file:

<expense>

  <user>https://api.irisopenbooks.co.uk/v2/users/205154</user>

  <category>https://api.irisopenbooks.co.uk/v2/categories/249</

category>

  <dated-on type="date">2015-12-13</dated-on>

  <mileage type="decimal">220.00</mileage>

  <description>test mileage</description>

  <vehicle-type>Car</vehicle-type>

  <reclaim_mileage_rate>0.4</reclaim_mileage_rate>

  <rebill_mileage_rate>0.4</rebill_mileage_rate>

I am using google auth play:

I created a token and added two headers

  • ‘Accept’ with value ‘application/xml’
  • and ‘Content-Type’ with value ‘application/xml’

and I I tried posting it using thr following URL

Before posting I ma setting the content type on the google auth play
user interface to: application/xml’

But it is coming with 500 error

HTTP/1.1 500 Internal Server Error

X-request-id: e3e817af-cfb7-4876-8914-6b5c736c315d

X-xss-protection: 1; mode=block

X-rev: 8577aa

X-content-type-options: nosniff

Transfer-encoding: chunked

Set-cookie: uid=bUl+XlZvEghbLwhQDrylAg==; expires=Tue, 13-Dec-16 19:01:28 GMT; domain=.freeagent.com; path=/

Vary: Origin

X-runtime: 0.031940

Server: nginx

Connection: keep-alive

Date: Mon, 14 Dec 2015 19:01:28 GMT

X-frame-options: SAMEORIGIN

Content-type: application/xml

X-host: web2-gc

This xml was working last time I tried in April this year.

Please help.

Pankaj


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_ap...@googlegroups.com.
To post to this group, send email to freeag...@googlegroups.com.
Visit this group at https://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.


David Jones
Senior Support Engineer

FreeAgent

Hi David

Sorry to bother again. While your mentioned solution fixed the problem, I
am now getting timeout, almost every 2nd/3rd transaction I am submitting.
The same app worked flawlessly last time. Is there any bottleneck on the
isiropenbook server at the moment? This is quite frustrating as I need to
upload transactions from April 2015 onwards.

Also I noticed that the type=date was used in generating XML for expenses,
mileage, invoices and bank transactions. While apart from mileage all other
works, do you think it is a good idea to remove that from all others as
this is more correct behaviour or this is a temp glitch in the code and
will be fixed in the future release, so I limit my changes to just mileage
type.

Thanks in advance
PankajOn Tuesday, 15 December 2015 12:59:10 UTC, Pankaj Jain wrote:

Hi David

Thanks for the reply.
I just tried your suggestion through Google OAuth Playground and now it
works.

Its strange that the API behavior have changed between march 2015 and now
as the XML were working file before and I have been scratching my head over
the weekend as why it has stopped working. I couldn’t figure out as I made
some changes to my batch uploaded app as well.

Anyway all sorted.
Cheers
Pankaj

On Tuesday, 15 December 2015 12:05:54 UTC, David Jones wrote:

Hi Pankaj,

Thank you for your message and I’m sorry to hear you’re having trouble,
I’m sure I can help.

I’ve investigated this issue with my colleague and using the XML you’ve
provided, we’ve been able to reproduce the issue.

FreeAgent expects that date values will be sent as a string, for example
“2015-12-13”, which we then convert into a Date.
In the XML you’ve provided, you’ve explicitly set the type=“date”
attribute which means the conversion isn’t required.

We need to make a change in our API to skip the conversion if a date has
already been supplied.
For now, you should be able to fix your integration by removing the type=“date”
attribute from dated-on element in your request:

  <dated-on>2015-12-13</dated-on>

Our apologies for the confusion and I hope this helps!

Kind regards,
Dave J

On 14 December 2015 at 19:17, Pankaj Jain jai...@gmail.com wrote:

Hi

It s working before but not any more

The XML that I am sending is stored in an XML file:

<expense>

  <user>https://api.irisopenbooks.co.uk/v2/users/205154</user>

  <category>https://api.irisopenbooks.co.uk/v2/categories/249</

category>

  <dated-on type="date">2015-12-13</dated-on>

  <mileage type="decimal">220.00</mileage>

  <description>test mileage</description>

  <vehicle-type>Car</vehicle-type>

  <reclaim_mileage_rate>0.4</reclaim_mileage_rate>

  <rebill_mileage_rate>0.4</rebill_mileage_rate>

I am using google auth play:

I created a token and added two headers

  • ‘Accept’ with value ‘application/xml’
  • and ‘Content-Type’ with value ‘application/xml’

and I I tried posting it using thr following URL

Before posting I ma setting the content type on the google auth play
user interface to: application/xml’

But it is coming with 500 error

HTTP/1.1 500 Internal Server Error

X-request-id: e3e817af-cfb7-4876-8914-6b5c736c315d

X-xss-protection: 1; mode=block

X-rev: 8577aa

X-content-type-options: nosniff

Transfer-encoding: chunked

Set-cookie: uid=bUl+XlZvEghbLwhQDrylAg==; expires=Tue, 13-Dec-16 19:01:28 GMT; domain=.freeagent.com; path=/

Vary: Origin

X-runtime: 0.031940

Server: nginx

Connection: keep-alive

Date: Mon, 14 Dec 2015 19:01:28 GMT

X-frame-options: SAMEORIGIN

Content-type: application/xml

X-host: web2-gc

This xml was working last time I tried in April this year.

Please help.

Pankaj


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_ap...@googlegroups.com.
To post to this group, send email to freeag...@googlegroups.com.
Visit this group at https://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.


David Jones
Senior Support Engineer

FreeAgent

Hi Pankaj,

Thank you for your message and I’m sorry to hear you’re having trouble, I’m
sure I can help.

I’ve investigated this issue with my colleague and using the XML you’ve
provided, we’ve been able to reproduce the issue.

FreeAgent expects that date values will be sent as a string, for example
“2015-12-13”, which we then convert into a Date.
In the XML you’ve provided, you’ve explicitly set the type=“date” attribute
which means the conversion isn’t required.

We need to make a change in our API to skip the conversion if a date has
already been supplied.
For now, you should be able to fix your integration by removing the
type=“date”
attribute from dated-on element in your request:

  <dated-on>2015-12-13</dated-on>

Our apologies for the confusion and I hope this helps!

Kind regards,
Dave JOn 14 December 2015 at 19:17, Pankaj Jain jainpj@gmail.com wrote:

Hi

It s working before but not any more

The XML that I am sending is stored in an XML file:

<expense>

  <user>https://api.irisopenbooks.co.uk/v2/users/205154</user>

  <category>https://api.irisopenbooks.co.uk/v2/categories/249</

category>

  <dated-on type="date">2015-12-13</dated-on>

  <mileage type="decimal">220.00</mileage>

  <description>test mileage</description>

  <vehicle-type>Car</vehicle-type>

  <reclaim_mileage_rate>0.4</reclaim_mileage_rate>

  <rebill_mileage_rate>0.4</rebill_mileage_rate>

I am using google auth play:

I created a token and added two headers

  • ‘Accept’ with value ‘application/xml’
  • and ‘Content-Type’ with value ‘application/xml’

and I I tried posting it using thr following URL

Before posting I ma setting the content type on the google auth play user
interface to: application/xml’

But it is coming with 500 error

HTTP/1.1 500 Internal Server Error

X-request-id: e3e817af-cfb7-4876-8914-6b5c736c315d

X-xss-protection: 1; mode=block

X-rev: 8577aa

X-content-type-options: nosniff

Transfer-encoding: chunked

Set-cookie: uid=bUl+XlZvEghbLwhQDrylAg==; expires=Tue, 13-Dec-16 19:01:28 GMT; domain=.freeagent.com; path=/

Vary: Origin

X-runtime: 0.031940

Server: nginx

Connection: keep-alive

Date: Mon, 14 Dec 2015 19:01:28 GMT

X-frame-options: SAMEORIGIN

Content-type: application/xml

X-host: web2-gc

This xml was working last time I tried in April this year.

Please help.

Pankaj


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 https://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.

David Jones
Senior Support Engineer

FreeAgent

Hi David

Thanks for the reply.
I just tried your suggestion through Google OAuth Playground and now it
works.

Its strange that the API behavior have changed between march 2015 and now
as the XML were working file before and I have been scratching my head over
the weekend as why it has stopped working. I couldn’t figure out as I made
some changes to my batch uploaded app as well.

Anyway all sorted.
Cheers
PankajOn Tuesday, 15 December 2015 12:05:54 UTC, David Jones wrote:

Hi Pankaj,

Thank you for your message and I’m sorry to hear you’re having trouble,
I’m sure I can help.

I’ve investigated this issue with my colleague and using the XML you’ve
provided, we’ve been able to reproduce the issue.

FreeAgent expects that date values will be sent as a string, for example
“2015-12-13”, which we then convert into a Date.
In the XML you’ve provided, you’ve explicitly set the type=“date”
attribute which means the conversion isn’t required.

We need to make a change in our API to skip the conversion if a date has
already been supplied.
For now, you should be able to fix your integration by removing the type=“date”
attribute from dated-on element in your request:

  <dated-on>2015-12-13</dated-on>

Our apologies for the confusion and I hope this helps!

Kind regards,
Dave J

On 14 December 2015 at 19:17, Pankaj Jain <jai...@gmail.com <javascript:>> wrote:

Hi

It s working before but not any more

The XML that I am sending is stored in an XML file:

<expense>

  <user>https://api.irisopenbooks.co.uk/v2/users/205154</user>

  <category>https://api.irisopenbooks.co.uk/v2/categories/249</

category>

  <dated-on type="date">2015-12-13</dated-on>

  <mileage type="decimal">220.00</mileage>

  <description>test mileage</description>

  <vehicle-type>Car</vehicle-type>

  <reclaim_mileage_rate>0.4</reclaim_mileage_rate>

  <rebill_mileage_rate>0.4</rebill_mileage_rate>

I am using google auth play:

I created a token and added two headers

  • ‘Accept’ with value ‘application/xml’
  • and ‘Content-Type’ with value ‘application/xml’

and I I tried posting it using thr following URL

Before posting I ma setting the content type on the google auth play user
interface to: application/xml’

But it is coming with 500 error

HTTP/1.1 500 Internal Server Error

X-request-id: e3e817af-cfb7-4876-8914-6b5c736c315d

X-xss-protection: 1; mode=block

X-rev: 8577aa

X-content-type-options: nosniff

Transfer-encoding: chunked

Set-cookie: uid=bUl+XlZvEghbLwhQDrylAg==; expires=Tue, 13-Dec-16 19:01:28 GMT; domain=.freeagent.com; path=/

Vary: Origin

X-runtime: 0.031940

Server: nginx

Connection: keep-alive

Date: Mon, 14 Dec 2015 19:01:28 GMT

X-frame-options: SAMEORIGIN

Content-type: application/xml

X-host: web2-gc

This xml was working last time I tried in April this year.

Please help.

Pankaj


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_ap...@googlegroups.com <javascript:>.
To post to this group, send email to freeag...@googlegroups.com
<javascript:>.
Visit this group at https://groups.google.com/group/freeagent_api.
For more options, visit https://groups.google.com/d/optout.


David Jones
Senior Support Engineer

FreeAgent