API suddenly returning error 404 - resource not found

The name of my app - Invoice Reader

A description of the problem - Our website has been reading from the
FreeAgent API quite happily for over a year (allowing customers to view and
update billing info) but just yesterday, all requests started coming back
as “resource not found”. I turned on full debugging, which has produced
the following information:

CApath: none

> GET /v2/contacts?per_page=100 HTTP/1.1

User-Agent: Lawford Education Ltd

Host: api.freeagent.com http://api.freeagent.com/

Accept: /

Content-length: 0

Content-type: application/json

Authorization: OAuth {HIDDEN}

< HTTP/1.1 404 Not Found

< Server: nginx

< Date: Fri, 09 Oct 2015 14:32:02 GMT

< Content-Type: application/json; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Status: 404 Not Found

< X-Frame-Options: SAMEORIGIN

< X-XSS-Protection: 1; mode=block

< X-Content-Type-Options: nosniff

< Access-Control-Allow-Origin: *

< Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUT

< Access-Control-Allow-Headers: Accept, Authorization, Content-Type

< Access-Control-Expose-Headers: Link

< Access-Control-Max-Age: 1728000

< Cache-Control: no-cache

< X-Request-Id: 5249aa70-1c16-4d2b-95fa-13d4466b97d9

< X-Rev: 0fe60a

< X-Host: web6-ash

< X-Runtime: 0.082813

< Set-Cookie: uid=1YFNslYXz+KAK2UmKouZAg==; expires=Sat, 08-Oct-16
14:32:02 GMT; domain=.freeagent.com http://freeagent.com/; path=/

<

This request was sent to the freeagent production environment.

Can anyone let me know what might be the cause and if so, how do I fix it?

The request was sent using PHP (I don’t know if that makes a difference)

Many thanks in advance,
Tim

Hi Tim,

Sorry for the issues. We recently made a change to the authentication code
which resulted in 404s being returned by mistake. We’ve now fixed this
issue and you should always get 401 when the token has expired!

Regards,
IoanOn Saturday, October 10, 2015 at 11:43:39 PM UTC+1, Tim Ballard wrote:

Hi Jonathan,

Thank you - refreshing the access token worked. Our system currently
refreshes the access token automatically when it receives the message
“Access token not recognised” but this message appears to have changed
to “resource not found” so our system did not even attempt to refresh the
access token. To fix the bug our end, I have adjusted our system
to refresh the access token when either error message is received, problem
solved.

Kind regards,
Tim

On Friday, 9 October 2015 16:29:57 UTC+1, Jonathan Barrett wrote:

Hi Tim,

It looks like the access token you’re using expired in the early hours of
this morning. You’ll need to have your app refresh the access token on
expiry https://dev.freeagent.com/docs/oauth#refreshing-the-access-token to
continue to access your FreeAgent data.

I’ve raised the fact that this is returning a 404 as a bug — it’s
obviously not very helpful in figuring out what the underlying problem is!

Hope this helps,

-J

On Friday, 9 October 2015 15:54:27 UTC+1, Tim Ballard wrote:

The name of my app - Invoice Reader

A description of the problem - Our website has been reading from the
FreeAgent API quite happily for over a year (allowing customers to view and
update billing info) but just yesterday, all requests started coming back
as “resource not found”. I turned on full debugging, which has produced
the following information:

CApath: none

> GET /v2/contacts?per_page=100 HTTP/1.1

User-Agent: Lawford Education Ltd

Host: api.freeagent.com http://api.freeagent.com/

Accept: /

Content-length: 0

Content-type: application/json

Authorization: OAuth {HIDDEN}

< HTTP/1.1 404 Not Found

< Server: nginx

< Date: Fri, 09 Oct 2015 14:32:02 GMT

< Content-Type: application/json; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Status: 404 Not Found

< X-Frame-Options: SAMEORIGIN

< X-XSS-Protection: 1; mode=block

< X-Content-Type-Options: nosniff

< Access-Control-Allow-Origin: *

< Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUT

< Access-Control-Allow-Headers: Accept, Authorization, Content-Type

< Access-Control-Expose-Headers: Link

< Access-Control-Max-Age: 1728000

< Cache-Control: no-cache

< X-Request-Id: 5249aa70-1c16-4d2b-95fa-13d4466b97d9

< X-Rev: 0fe60a

< X-Host: web6-ash

< X-Runtime: 0.082813

< Set-Cookie: uid=1YFNslYXz+KAK2UmKouZAg==; expires=Sat, 08-Oct-16
14:32:02 GMT; domain=.freeagent.com http://freeagent.com/; path=/

<

This request was sent to the freeagent production environment.

Can anyone let me know what might be the cause and if so, how do I fix
it?

The request was sent using PHP (I don’t know if that makes a difference)

Many thanks in advance,
Tim

Hi Jonathan,

Thank you - refreshing the access token worked. Our system currently
refreshes the access token automatically when it receives the message
“Access token not recognised” but this message appears to have changed
to “resource not found” so our system did not even attempt to refresh the
access token. To fix the bug our end, I have adjusted our system
to refresh the access token when either error message is received, problem
solved.

Kind regards,
TimOn Friday, 9 October 2015 16:29:57 UTC+1, Jonathan Barrett wrote:

Hi Tim,

It looks like the access token you’re using expired in the early hours of
this morning. You’ll need to have your app refresh the access token on
expiry https://dev.freeagent.com/docs/oauth#refreshing-the-access-token to
continue to access your FreeAgent data.

I’ve raised the fact that this is returning a 404 as a bug — it’s
obviously not very helpful in figuring out what the underlying problem is!

Hope this helps,

-J

On Friday, 9 October 2015 15:54:27 UTC+1, Tim Ballard wrote:

The name of my app - Invoice Reader

A description of the problem - Our website has been reading from the
FreeAgent API quite happily for over a year (allowing customers to view and
update billing info) but just yesterday, all requests started coming back
as “resource not found”. I turned on full debugging, which has produced
the following information:

CApath: none

> GET /v2/contacts?per_page=100 HTTP/1.1

User-Agent: Lawford Education Ltd

Host: api.freeagent.com http://api.freeagent.com/

Accept: /

Content-length: 0

Content-type: application/json

Authorization: OAuth {HIDDEN}

< HTTP/1.1 404 Not Found

< Server: nginx

< Date: Fri, 09 Oct 2015 14:32:02 GMT

< Content-Type: application/json; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Status: 404 Not Found

< X-Frame-Options: SAMEORIGIN

< X-XSS-Protection: 1; mode=block

< X-Content-Type-Options: nosniff

< Access-Control-Allow-Origin: *

< Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUT

< Access-Control-Allow-Headers: Accept, Authorization, Content-Type

< Access-Control-Expose-Headers: Link

< Access-Control-Max-Age: 1728000

< Cache-Control: no-cache

< X-Request-Id: 5249aa70-1c16-4d2b-95fa-13d4466b97d9

< X-Rev: 0fe60a

< X-Host: web6-ash

< X-Runtime: 0.082813

< Set-Cookie: uid=1YFNslYXz+KAK2UmKouZAg==; expires=Sat, 08-Oct-16
14:32:02 GMT; domain=.freeagent.com http://freeagent.com/; path=/

<

This request was sent to the freeagent production environment.

Can anyone let me know what might be the cause and if so, how do I fix it?

The request was sent using PHP (I don’t know if that makes a difference)

Many thanks in advance,
Tim

Hi Tim,

It looks like the access token you’re using expired in the early hours of
this morning. You’ll need to have your app refresh the access token on
expiry https://dev.freeagent.com/docs/oauth#refreshing-the-access-token to
continue to access your FreeAgent data.

I’ve raised the fact that this is returning a 404 as a bug — it’s obviously
not very helpful in figuring out what the underlying problem is!

Hope this helps,

-JOn Friday, 9 October 2015 15:54:27 UTC+1, Tim Ballard wrote:

The name of my app - Invoice Reader

A description of the problem - Our website has been reading from the
FreeAgent API quite happily for over a year (allowing customers to view and
update billing info) but just yesterday, all requests started coming back
as “resource not found”. I turned on full debugging, which has produced
the following information:

CApath: none

> GET /v2/contacts?per_page=100 HTTP/1.1

User-Agent: Lawford Education Ltd

Host: api.freeagent.com http://api.freeagent.com/

Accept: /

Content-length: 0

Content-type: application/json

Authorization: OAuth {HIDDEN}

< HTTP/1.1 404 Not Found

< Server: nginx

< Date: Fri, 09 Oct 2015 14:32:02 GMT

< Content-Type: application/json; charset=utf-8

< Transfer-Encoding: chunked

< Connection: keep-alive

< Status: 404 Not Found

< X-Frame-Options: SAMEORIGIN

< X-XSS-Protection: 1; mode=block

< X-Content-Type-Options: nosniff

< Access-Control-Allow-Origin: *

< Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, POST, PUT

< Access-Control-Allow-Headers: Accept, Authorization, Content-Type

< Access-Control-Expose-Headers: Link

< Access-Control-Max-Age: 1728000

< Cache-Control: no-cache

< X-Request-Id: 5249aa70-1c16-4d2b-95fa-13d4466b97d9

< X-Rev: 0fe60a

< X-Host: web6-ash

< X-Runtime: 0.082813

< Set-Cookie: uid=1YFNslYXz+KAK2UmKouZAg==; expires=Sat, 08-Oct-16
14:32:02 GMT; domain=.freeagent.com http://freeagent.com/; path=/

<

This request was sent to the freeagent production environment.

Can anyone let me know what might be the cause and if so, how do I fix it?

The request was sent using PHP (I don’t know if that makes a difference)

Many thanks in advance,
Tim