API key setup & authentication

Get your integration started by setting up your API keys and authenticating with the Go1 API.

Overview

This guide walks through how to set up your API keys and authenticate with the API. If you’re integrating with Go1’s tools and products via the API, setting up your API keys & authentication process is typically the first step you’ll need to complete as you begin building your integration.

API keys comprise of client_idclient_secret & redirect_url. These keys are generated within your Go1 portal by creating a developers app - we’ll walk through these steps in detail below.

How it works

In this guide we’ll walk through the following steps:

  1. Set up: Creating your API Keys
  2. Authentication: Retrieving an access token with your API Keys

We’ll walk through both of these steps in greater detail below.

Preparation

Before you can provision your API keys, you’ll first need a Go1 Portal & Author account - learn how to set up your account via our Setup a Go1 Portal and Author account guide.

Implementation steps
Step 1. Set up: Create your API Keys

To set up your API keys, you’ll need to create a developers app within your Go1 Portal. The developer's app will provide you with your API keys, consisting of a client_id, client_secret and redirect_url.

To set up the developers app, follow the guide linked below:

Once you’ve created your API keys, you’ll be able to authenticate and begin interacting with the Go1 API. We’ve provided a brief authentication guide in step 2 below. To learn more about our Authentication methods at Go1, see Authentication with Go1.

Step 2. Authentication: Retrieve an access token

An access token is required to authorize a request to the Go1 API. In this guide, we recommend using the Client Credentials authentication grant type to retrieve your access token. We’ll walk through the process to retrieve an access token in the steps below.

You will need your API keys (client id & client secret), to complete this request - see step 1 above.

1.1. To retrieve an access token, make a POST request to https://auth.go1.com/oauth/token passing in your partner Client ID and Secret, and setting the grant type to client_credentials.

curl --location --request POST 'https://auth.go1.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=<CLIENT_ID>' \
--data-urlencode 'client_secret=<CLIENT_SECRET>' \
--data-urlencode 'grant_type=client_credentials'

1.2. The result of a successful request will return an access_token.

 {
    "token_type": "Bearer",
    "expires_in": 43200,
    "access_token": "eyJ0e3efms33f..."
 }

The returned access token will be used to authorize your requests to the API. Note, the returned token is valid for 12 hours, at which point you will need to request a new token.

An example of an API request using the returned token might look like this:

curl -X POST -H "Authorization: Bearer <ACCESS_TOKEN>" "<https://api.go1.com/v2/ENDPOINT>"

Provided the access token remains valid, the request will be processed according to API specifications. If the access token expires or is removed, an 'Invalid token' error will be presented.

Learn more