Loading...

How to Authorise and Test the Wisenet API Using Postman

The purpose of this article is to help users who are new to the Wisenet API understand how to authorise access and test API calls using Postman.

This article provides a practical, step-by-step guide to:

  • Importing a sample Postman collection for the Wisenet API

  • Completing the OAuth 2.1 authorisation code flow, including:

    • Building and opening the Authorise URL in a browser

    • Signing in and granting consent for the required scopes

    • Retrieving the authorisation code from the browser URL

    • Exchanging the authorisation code for access and refresh tokens

  • Storing the access_token, refresh_token, and api_key as Postman variables

  • Making a test API request (such as Get All Agents)

  • Refreshing the access token and re-running the API request

Step 1: Import the sample Postman collection

1

Download the sample Postman collection file

iae-manual-oauth-collection

2

Open Postman and import the collection

3

  • Go to File → Import
  • Select the downloaded JSON file

Once imported, the Wisenet API collection will appear in your Postman workspace.

Step 2: Authorise (Open in Browser)

1

Configure collection variables
  • Open the imported collection and navigate to the Variables tab.

  • Enter your Client ID in the client_id variable.

The Client ID can be found in Wisenet → Settings → Developer Tools.

Collection variables can be accessed from the variables tab on the main collection screen, or the sidebar.

2

Review the configured scope(s).
  • For initial learning, leave the default scopes as provided.

  • Ensure the scopes you use have been configured for your API application.

3

Get the Authorise request URL

Locate the access URL from the sidebar.

Select cURL from the dropdown if it isn’t already selected.

Copy only the URL, excluding the single quotes, and the “curl –location” text

4

Paste the URL into your browser’s address bar and press Enter.

This initiates the authorisation step of the OAuth 2.1 flow.

5

Authenticate and grant consent

Sign in when prompted.

6

7

8

Retrieve the authorisation code

After authorisation, you will be redirected to a URL containing the authorisation code.

You can retrieve the code in one of two ways:

  • Option 1: Manually copy the code value from the browser URL

  • Option 2: Open the browser console and run the following command:

new URLSearchParams(window.location.search).get('code')

Copy the returned code value, excluding any single quotes.

Step 3: Exchange the code for an access token

1

Return to Postman and open the Exchange Code for Token request.

2

If successful, the response will return:

  • access_token

  • refresh_token

  • api_key

You can access the collection variables from the side bar.

3

You are now ready to make a request to the resource server – Step 7 of the Flow

4

Configure tokens in Postman
  1. Copy the access_token and api_key values from the response.

  2. Paste them into their corresponding collection variables.

You can now make authenticated requests to the Wisenet API.

5

Test the API connection
  1. Open the Get All Agents request.

  2. Send the request to confirm successful authorisation and connectivity.

A valid response indicates the API is correctly configured.

Step 4: Refresh the Access Token

1

  • Copy the refresh_token value from the previous response.

  • Paste it into the refresh_token collection variable.

2

Send the Refresh Token request.

A new set of tokens and an updated api_key will be returned.
Use these values to continue making authenticated API calls.