Hi Rikky,
Apologies for the delayed response. Looks like the issue is caused by an
incorrect Content-Type
header. It should be
“application/json” instead of
“application/x-www-form-urlencoded;charset=UTF-8”. We acknowledge this
mistake in the API docs and we will correct it.
Meanwhile, could you please try the following?
Header:
Content-Type: application/json
Accept: application/json
Authorization: Basic
Request body:
{“grant_type”:“refresh_token”,“refresh_token”:“”}
Here’s a quick example to verify it using a curl command:
curl -H “Content-Type: application/json” -H “Authorization: Basic ” -H “Accept: application/json” -X POST -d
‘{“grant_type”:“refresh_token”,“refresh_token”:“<refresh_token>”}’
https://api.freeagent.com/v2/token_endpoint
Let me know if this helps.
Anup NarkhedeOn Tuesday, July 19, 2016 at 12:12:33 PM UTC+1, Rikky wrote:
Hi,
I’m new to FreeAgent and OAuth in general and was trying to get a refresh
token implemented but am having some problems.I’m sending a request via Fiddler as follows:
POST request sent to: https://api.freeagent.com/v2/token_endpoint
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
Host: api.freeagent.com
Accept: application/json
Authorization: BasicThe request body contains: grant_type=refresh_token&refresh_token=
The access token has not expired when I try but I seem to always get a 401
Access Denied response.Any ideas what I’m doing wrong?
I’ve also tried this in C# code and also get a 401.
Thanks,
Rikky.