Quick start using the Google OAuth 2.0 Playground.
The Google OAuth 2.0 Playground enables developers to explore OAuth 2.0 compatible APIs without writing code.
To use the FreeAgent API with the Google OAuth 2.0 Playground, you must do the following:
- Create a free temporary FreeAgent user account at the FreeAgent Sandbox.
- Sign into the company and complete the setup stages. If you don't do this, you will receive unexpected error messages when using the API.
We'll link the OAuth Playground to this user account.
- Create an App at the FreeAgent Developer Dashboard.
The OAuth identifier and secret will be needed for the OAuth Playground.
- Follow these instructions to get an Access Token
The Access Token can be used with the OAuth Playground, Curl and your own apps during development.
To use the production API change the server in the examples below to: api.freeagent.com
Go to the Google OAuth 2.0 Playground
The URL above sets up the Playground with FreeAgent's OAuth Authorization Endpoint:
and the OAuth Token Endpoint:
Click on the Cog icon and enter the OAuth Client ID and OAuth Client Secret for the App created above.
With the Link icon you can create a link to save these settings for future use and if you tick Include OAuth credentials and OAuth tokens in the link you won't have to enter the Client ID and Secret each time.
Enter some text in the Scope box. Google requires this to have a value but the FreeAgent API doesn't enforce its use.
Click Authorize APIs.
The Playground will redirect you to the Sandbox where you will have to log in to the FreeAgent Sandbox account you created earlier. After log in you can approve the Playground app.
Approving the app will return you to the Playground. Click Exchange Authorization Code for Tokens to create access and refresh tokens which can be used to access the API.
You can then access the FreeAgent API for the Sandbox account you authorised. For example try:
which should produce:
Now that you have an Access Token, you can also use it with Curl or use it to test out your own app with the FreeAgent API before you implement OAuth authentication.
Next up, Introducing the FreeAgent API