Log in
Play content using the Go1 Player
Overview

The Go1 Player method allows you to send your users out to the Go1 platform to consume content using Go1's player. You do this by issuing a single-use 'login&redirect' URL to your users via the API.

The 'login&redirect' URL consists of:

  • a one-time-login token - used to log an existing user into the Go1 platform without them needing to enter a username and password
  • the redirect_url property - used to redirect the learner directly into the Go1 player to consume the content once they have been logged in.

A 'login&redirect' URL must be generated for each piece of Go1 content that you wish to surface to a user, and is unique to each user. We'll walk through how to generate this in the steps below.

Note, the 'login&redirect' URL can be embedded directly into your platform. So, although this method technically sends the user out to consume the content inside Go1, to the end-user it will look like the content is being launched and played seamlessly inside of your platform.

Prerequisite
  • Ability to retrieve a Learning Object ID (LO ID) - In order to play Go1 content, you will need to know which piece of content to surface to the user (used in step 3 below). Go1 content is represented by a Learning Object ID (LO ID) in the Go1 API. We recommend familiarizing yourself with the Search and Display GO1 Content guide to understand how to retrieve a Learning Object ID.
Step 1. Create a Go1 user and retrieve their user-id

Before you can surface Go1 content to a user (by logging them into the Go1 player), the user must have an existing Go1 account.

To create a Go1 account, make a POST request to https://api.go1.com/v2/users:

{
  "email": "{{users_email_address}}",
  "first_name": "{{users_first_name}}",
  "last_name": "{{users_last_name}}",
  "roles": [
    "Learner"
  ],
  "send_login_email": true,
  },
}

Go1 returns a response that includes the user id:

{
  "id": 44,
  "email": "[email protected]",
  "first_name": "John",
  "last_name": "Doe",
  "created": "2020-04-12T07:15:50Z",
  "last_login": "2020-04-12T07:15:50Z",
  "roles": [
    "Learner"
  ],
  "status": true
}

Capture and store the returned Go1 user id to be used in the next step.

Step 2. Generate a one-time-login token

To generate the one-time-login token for a user, make a POST request to https://api.go1.com/v2/users/{user-id}/login, replacing {user-id} with the stored user id from step 1:

https://api.go1.com/v2/users/44/login

Note, access to this endpoint requires the user.login scope, which is not enabled by default, please contact your Implementation Manager or [email protected] for access.

The Go1 API will return a single-use login token, in the form of a URL:

{
  "url": "https://customersportal.mygo1.com/p/#/one-time-link?token=1:1234567:abcd-efgh:customersportal.mygo1.com"
}

When consumed, the returned login URL will log the user directly into the Go1 platform without needing to enter their username or password. By default, the user will be logged into their Go1 dashboard (the homepage in the Go1 platform).

In step 3, we'll expand on the login URL concept, illustrating how to log the user directly into the Go1 player, where they can view a piece of Go1 content.

Step 3. Construct the 'login&redirect' URL to play Go1 content

In step 2 we learnt how to generate a one-time-login link, used to log a user into the Go1 dashboard. In this step, we'll expand on the login link concept outlined in step 2, by adding the 'redirect_url' property - thus creating the login&redirect URL designed to log users into the Go1 player.

To construct the login&redirect URL, you need the following pieces of information:

  • a user ID - this is required to generate the one-time-login-link (see steps 1 & 2 above)
  • a redirect URL - the redirect URL must be set to 'redirect_url=/play/{LOID}' (this is explained in the segment below)
  • a learning object ID - before making the POST request to log the user into the Go1 player, you will need to retrieve the LOID of the Go1 learning object you wish to play. For more information on how to retrieve a LOID, see Search and Display Go1 Content.

The redirect URL property

The redirect_url property is a query parameter, which can be added to the one-time-login link POST request we made in step 2. The redirect URL is used to set the landing destination for the user upon login to the Go1 platform.

You can set the redirect_url to any part of the Go1 platform - In this use case, we want to log the user directly into the Go1 player in order to play Go1 content.

The standard URL schema for playing a Go1 learning object via the Go1 player is https://[portal-domain]/play/{LOID}. This URL should be abbreviated to /play/{LOID} while using the redirect_url property in the one-time-login link POST request.

Example request

With the above as context, you should now have everything needed to generate a login&redirect URL, to log the user into the Go1 player.

Below is an example of the POST request used to generate a one-time-login link with the redirect_url set to log the user into the Go1 player:

https://api.go1.com/v2/users/{user-id}/login?redirect_url=/play/{LOID}

Upon a successful request, the Go1 API will return a single use login URL, which will log the user into the Go1 player:

{
  "url": "https://customersportal.mygo1.com/p/#/one-time-link?token=1:1234567:abcd-efgh:customersportal.mygo1.com/play/{LOID}"
}

And you're done! Remember, you can embed the returned URL into your platform to make the content playing experience seamless for your users.

Optional. Configure the Go1 Player

The Go1 player has various properties that can be customised, such as; setting an exit state upon completion of content, the ability to show/hide the player header and sider bar panels, the ability to remove the exit button, etc. For more information and a full list of customisable properties, see Customising the Go1 Player.

© Copyright 2020 · All Rights Reserved