Product documentation

Connecting to LMS and WebLink APIs in Postman

This guide provides a step-by-step walkthrough for connecting to the LMS and WebLink APIs using Postman.

This guide provides a step-by-step walkthrough for connecting to the LMS and WebLink APIs using Postman.

Contents


WebLink Authorization (Guest User)

Depending on your portal configuration, you may be able to access WebLink as a guest user.

Step 1: Retrieve a guest user token

In Postman, click Import at the top left of the window.

Screenshot showing the Import button in Postman

In the box that opens, copy and paste the cURL below.

curl 'https://portal-auth.administratehq.com/portal/guest' \
-X POST \
-H 'Content-Type: application/json;charset=utf-8' \
--data-raw '{"domain": "<portalBaseUrl>"}'

Click the Body tab, replace portalBaseUrl with your portal, and then click Send.

For example: example.administrateweblink.com

Copy the token from the response.

Step 2: Use the guest user token

Select the Authorization tab of the request or environment where you want to use the token.

Change the auth type to Bearer Token and paste your token into the Token field.

You can now access the WebLink GraphQL API, as shown in the example below.

Screenshot showing a bearer token being used in Postman


WebLink & LMS Authorization (Authenticated User)

Step 1: Retrieve the portal configuration

First, access your portal configuration data using one of the following URLs:

  • LMS: https://your_portal.administratelms.com/config
  • WebLink: https://your_portal.administrateweblink.com/config

In the returned data, note the following values:

  • From the idp section:
    • client_id
  • brand

Step 2: Create a new environment

In Postman, create a new environment by selecting Environment > +.

Screenshot showing how to create a new Postman environment

Add the following environment values:

  • brand: use the brand value you retrieved in step 1
  • client_id: use the client_id value you retrieved in step 1
  • code_verifier: use a random, unique string that you choose
  • idp_domain: getadministrate
  • api_domain: administratehq

Screenshot showing environment values in Postman

In the top right, set your new environment as the active environment.

Screenshot showing the active environment selector in Postman

Step 3: Create a collection and configure authentication

Create a new collection by selecting Collection > +.

Screenshot showing how to create a new Postman collection

Open the Authorization tab for the collection and set:

  • Auth Type: OAuth 2.0
  • Add auth data to: Request Headers

In the Configure New Token section, set the following values:

  • Token Name: <What_you_want_it_named>
  • Grant Type: Authorization Code (With PKCE)
  • Callback URL: https://postman-echo.com/get
  • Auth URL: https://identity.{{idp_domain}}.com/authorize?brand={{brand}}
  • Access Token URL: https://identity.{{idp_domain}}.com/token
  • Client ID: {{client_id}}
  • Client Secret: {{code_verifier}}
  • Code Challenge Method: SHA-256
  • Client Authentication: Send as Basic Auth header

Select Get New Access Token.

Screenshot showing the Get New Access Token button in Postman

Step 4: Log in

LMS only: You need a learner on that instance to log in.

Postman will display a window for you to log in as that LMS user.

Once you log in, you should see the token window shown below.

WebLink only: After you select Get New Access Token, you will see this same token window.

Screenshot showing the Postman access token window


When querying the WebLink API, you must add the WebLink portal to your request headers.

  • Key: weblink-portal
  • Value: your-portal.administrateweblink.com

Screenshot showing the required weblink-portal header in Postman