Pearson
Always Learning

Postman is a utility that we use here at Pearson to easily explore the functionality provided by a given API set. The ability to invoke the API, modify the requests and view the responses in an easy to use interface can prove to be a valuable tool when beginning the initial design work of your application as well as researching any issues you might be encountering.

As a means to help you get started, we’ve created a Postman collection which contains a sample set of API calls to the LearningStudio API set. The sample set contains a small fraction of the overall number of APIs but it will give some exposure to the APIs as well as in a proper sequence as some IDs are needed from previous API calls in order to invoke subsequent API calls.

Summarized below are the steps to get your Postman Collection imported which will allow you to begin testing out the APIs:

Prerequisites

This process assumes you have created a developer app through the Pearson Developer’s Network portal. If you haven’t yet you can do so here.

Once you have created a developer app, you will receive three key pieces of information which you will need in order to successfully make API calls using the Postman collection:

  • Application ID (also known as Client ID)
  • Client String For The Sandbox Campus
  • Sample User Credentials - Username and password values for your test users

With these three pieces of information you can proceed to step 1 below.

Step 1 - Install Postman

Postman is Chrome app which can be installed by following the link on the Postman site and following the instructions within the Chrome store.

Step 2 - Set Up Postman Environment

Using Environments in Postman allows you assign both static variables (username and password values for a test user) as well as as dynamic variables (access token value for a given session) which are used within your API flows. To help get you up and running quickly we've created an Environment for which you will simply need to input your assigned applicable API key and sample user credentials. In order to set up the LearningStudio environment in Postman you will need to d the following:

  1. Download the Postman Environment resource from the link provided here
  2. Log in to Postman and located within the top right hand portion of the screen within the Environments dropdown list, select "Manage Environments".
  3. Click Import on the Manage Environments screen and upload the Environment file downloaded as part of step 1 above.
  4. Once the Environment has been created within your instance of Postman, you will need to assign three variables to complete the set-up process - (i) for the application ID value replace the text "applicationID_from_email" with the corresponding value you received in the LearningStudio Keys & Sandbox Request email when creating your developer app, (ii) for the username value replace the text "username_here" with the username value of the sandbox user created for you and (iii) for the password value replace the text "password_here" with the password associated to your test user.
  5. The placeholder token value can be left as is as it will be updated once you initiate a request to the Token API. The campus identifier of "gbtestc" can be left as is as well. You can choose to update this value later as your work migrates to different campuses.
  6. Once you have everything set up, click the Update button to save the changes made to your LearningStudio Environment.

Step 3 - Import LearningStudio API Collection Into Postman

We’ve gone ahead and created a Postman Collection that contains a subset of the LearningStudio API set. To import the collection into your Postman set-up, you will do the following:

  1. Click the Import icon at the top of the Postman interface.
    Postman Import
  2. Click the “Download from link” option.
  3. Enter the following URL in the field provided - https://www.getpostman.com/collections/457dc4e55a02a5d4c5b1
    Postman Import From Link
  4. Click “Import!” and you should now see the collection “LearningStudio APIs” listed on the left hand side of the Postman interface under Collections.

Step 4 - Request Access Token

  1. Click the “Token Request” entry within the Postman collection you previously imported. Send the POST request to initiate the process of generating a session access token.
  2. If you receive a 200 status code (Successful) message back the access token value will be retrieved from the response and stored within your environment in order to make subsequent calls to the API sets in the collection.
  3. Please note that the access token that you receive in the response can only be used for 60 minutes. To request a new token, you will simply need to submit an additional request to the Token Request API to have the new access token be retrieved and stored as an updated Environment variable.

Step 5 - Invoke API Request To Corresponding LearningStudio API

  1. Select one of the requests contained in the collection. For example, click What's Happening Feed (v2) link.
  2. For some of the APIs in the collection, no changes or updates are needed to the API route. In many of the APIs, however there will be placeholder values in the route which pertain to a course ID, user ID, etc. So for example the route https://api.learningstudio.com/courses/{courseID}/roster contains a placeholder value for course ID which will need to be updated before you can successfully submit the API request. An example of the updated route would be: https://api.learningstudio.com/courses/1234234/roster
  3. Click Send to submit the request including the access token assigned. Note that access tokens are valid for 60 minutes after which time you will need to request another token using the Token Request flow.
3121 reads
Always Learning
Pearson