Connect your customer to Go1 by auto-provision customer accounts using the Onboard API endpoint.
This guide demonstrates the process of creating a customer account, also known as a portal, using the onboard API. By following the steps of this guide – you will have the toolset to programmatically provision Portals for your customers. Each onboarded customer will provide you with a unique access_token which you will need for future interactions when calling the API on the customer's behalf.
Why creating customer portals is required?
When integrating with Go1 under a Reseller or Referrer arrangement (ie. you are partnering with Go1 to provide a content offering to your customers), you are required to create a unique portal entity for each customer you provide content to.
Customer portals are the gateway for each customer (and their users) to access Go1 content and contains unique information about customer usage for reporting, billing & insights.
Why use the API to create customer portals?
Creating customer portals via the onboard API is the most flexible solution for connecting your customers to Go1. It allows you to control the entire user experience programmatically when setting your customers up with access to Go1 content.
There are two interactions required to create customer portals via the onboard API.
We’ll walk through both of these steps in greater detail below.
Although a simple API call creates a Customer Portal, you’ll need to ensure you have all of the required fields ready to build this request. Below is a list of the key details you’ll need to prepare:
In addition to preparing the above customer details, familiarize yourself with the below attributes that will be included in the API request:
For a complete list of available attributes in the onboard request, see the API Reference.
An access token is required to authorize a request to the Onboard 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 Partner API credentials (client id & client secret), to complete this request. See the Partner API Keys Setup Guide if you do not yet have your client id & secret available.
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=<PARTNER_CLIENT_ID>' \ --data-urlencode 'client_secret=<PARTENR_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 onboard API request in step 2 below. Note, the returned token is valid for 12 hours, at which point you will need to request a new token.
Reference Documentation
2.1. To create a portal, make a POST request to https://api.go1.com/v2/onboard.
Header { "Authorization": "Bearer <ACCESS_TOKEN>", "Content-Type": "application/json" } Body { "creation_path": "integration", "customer": { "name": "<CUSTOMERS NAME>", "industry": "<CUSTOMERS INDUSTRY>", "country": "<CUSTOMERS COUNTRY>" }, "partner_portal_id": <PARTNER_ID>, "portal": { "domain": "<CUSTOMERIDENTIFIER>.mygo1.com", "seats": 5, "content_group_ids": [<CONTENT_GROUP_IDS>], "client_auth": true, "notifications": false }, "user": { "email": "<CUSTOMERS_EMAIL>", "first_name": "<CUSTOMERS_FIRSTNAME>", "last_name": "<CUSTOMERS_LASTNAME>", "password": "<PASSWORD>" "phone": <CUSTOMERS_PHONE_NUMBER>, "consent": { "term_privacy": true, "term_tos": true, "term_collection": true } } }
2.2. A successful request will return the newly created portal and user object in the response, as well as the customer's access & refresh tokens and client id & secret.
{ "user": { <USER_DETAILS>, "oauth_token": { "token_type": "Bearer", "expires_in": 43200, "access_token": "eyJ0eXAiOiJKV1QiLC...", "refresh_token": "def50200428beca7e..." } }, "portal": { <PORTAL_DETAILS>, "client_auth": { "client_id": "0jh3hewa34vvsdzcvgy4C...", "client_secret": "82jf8jw383fefe33f3EE...", "redirect_uri": "http://localhost" } } }
2.3. Store the returned customer's access & refresh tokens and client id & secret. These credentials will be used in future interactions when calling the API on the customer's behalf.
Reference Documentation
Learn more about working with customer Portals.