How to use curl to refresh token

Newbie and hoping somebody can help. I am trying to automate the refresh token step in FileMaker Pro and I am having difficulty in finding out the full steps involved. My code which doesn’t work looks something like this:

curl https://api.sandbox.freeagent.com/v2/token_endpoint \

-H “Content-Type: application/json” \

-H 'Authorization: Basic ’ client_id=[Application Client Id]&client_secret=[Application Client Secret]\

-H ‘Accept: application/json’ \

-X POST -d
‘{“grant_type”:“refresh_token”,“refresh_token”:“<refresh_token>”}’

Hi shaggy2dogs :waving_hand:

David from FreeAgent here. It looks like the problem with your request is the format of the Authorization header.

The format of this header should include your client ID and client secret joined by a colon and base64 encoded. Like this:

-H ‘Authorization: Basic Base64Encode(“<Client ID>:<Client Secret>”)’

So if your client id was “foo” and the client secret “bar”, then your header should be:

-H ‘Authorization: Basic Zm9vOmJhcg==’

Hope this helps.

Kind regards,
David

Many thanks - all good now.