This guide provides a step by step guide on how to connect the LMS and WebLink APIs using Postman.
WebLink Authorization (Guest User)
For WebLink, depending on your portal configuration you may be able to access it as a Guest User.
Step 1: Retrieving a Guest User Token
In Postman, click the Import button at the top left of the window.
In the box that pops up, 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 and replace portalBaseURL with your portal and 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 wish to use the token.
Change the Auth Type to "Bearer Token" and paste your token into the Token field.
You may now access the WebLink GraphQL API as shown in the simple query below.
WebLink & LMS Authorization (Authenticated User)
Step 1: Retrieving the Portal Configuration
You will need to access the config data of the portal which can be done at:
LMS - https://your_portal.administratelms.com/config
WebLink - https://your_portal.administrateweblink.com/config
In the returned data take note of the following -
-
From the
idp
section:-
client_id
-
-
brand
Step 2: Create a New Environment
You will need to create a new Environment in Postman by selecting "Environment" -> "+" -
Add the following.
The brand
with the one you got from step 1.
The client_id
with the one you got from step 1.
The code_verifier
with a random, unique string that you choose.
The idp_domain
with getadministrate
The api_domain
with administratehq
In the top right, set your new environment to be your active environment.
Step 3: Create a Collection and Authenticate
Create a new Collection by selecting "Collection" -> "+" -
Go to the "Authorisation" tab of the collection select -
Auth Type - OAuth 2.0
Add auth data to - Request Headers
Scroll down to the "Configure New Token" section and set the 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" -
Step 5: Logging in as an LMS user
LMS ONLY: You need a learner on that instance to log in.
Postman will display a window for you to log in as this LMS user.
Once you log in, you should see this window.
WEBLINK ONLY: Once selecting "Get New Access Token" you will see this window.
Header Required for Querying Using WebLink API
When querying the WebLink API you need to add the WebLink Portal to your Headers.
Key - weblink-portal
Value - your-portal.administrateweblink.com
Comments
0 comments
Please sign in to leave a comment.