HomeGuidesAPI Reference
GuidesAPI ReferenceGitHubAirheads Developer CommunityLog In
Guides

Token Management with Postman

You can manage your HPE Aruba Networking Central tokens using the Token Management collection within HPE Aruba Networking Central Postman Collection . These token management workflows have been simplified with the help of Postman Collection Runners.

📘

Postman Definition

The Collection Runner enables you to run the requests in a Postman Collection in a specified order to test the functionality of your API. The Collection Runner logs the test results for each request, and it can use scripts to pass data between requests and change the request workflow.

Create Token (Non-SSO Users)

🚧

Note

The steps mentioned below are valid only for non-SSO users. A non-SSO user is a local/system user that does not share the same domain name as SSO users.

SSO Users can create tokens from HPE Aruba Networking Central UI. Once created, they can add the access_token, refresh_token, client_ID and client_secret tokens in the HPE Aruba Networking Central ENV environment to make API calls to HPE Aruba Networking Central & refresh access tokens via Postman.

You can create access tokens using the Create Token's collection runner. You can follow the steps listed below to use the Create Token Collection runner to create access tokens:

  1. Within your personal workspace, select the Environments tab and add values for the following variables in the HPE Aruba Networking Central ENV:
VariableDescription
base_urlDomain Base URL for HPE Aruba Networking Central API Gateway based on the geographical cluster where your account is registered.
central_usernameUsername used to login to the HPE Greenlake platform to access the HPE Aruba Networking Central instance.
central_passwordPassword associated with the above-mentioned username.
client_idUnique Application ID associated with the client.
client_secretUnique Application secret ID associated with the client.
customer_idUnique ID of the HPE Aruba Networking Central account.
  1. Once the valid values are set, save the environment, and set the HPE Aruba Networking Central ENV as the active environment for your workspace.
  2. Click on the Collections tab and select HPE Aruba Networking Central collection. Within the collection, go to Create Token(Non SSO Users) collection in Token Management
  3. Click on Run to open this collection's runner. You don't have to make any changes to run options.
  4. Click on Run HPE Aruba Networking Central.

This collection runner will sequentially make the OAuth API calls required to create tokens. You can check with Postman console to see the status of the collection runner. If successful, the access token will be generated and the following variables will updated in HPE Aruba Networking Central ENV environment:

VariableDescription
access_tokenAccess Token is required to securely make an API Request to HPE Aruba Networking Central API Gateway.
refresh_tokenRefresh tokens are used to refresh the access_token when it expires without having to repeat the above API calls.
csrf_token & session_tokenThese are the session variables that were used to create the access token. They are needed if you want to delete the access token later on.
Steps to create access token using Create Token collection runner

Steps to use Create Token collection runner

Refresh Token

Access token expires after a certain time. Refresh token API should be used to refresh the tokens before and after they expire. You can follow the below steps to use the Refresh Token collection runner to refresh access tokens:

  1. Within your personal workspace, select the Environments tab and add values for the following variables in the HPE Aruba Networking Central ENV:
VariableDescription
base_urlDomain Base URL for HPE Aruba Networking Central API Gateway based on the geographical cluster where your account is registered.
client_idUnique Application ID associated with the user.
client_secretUnique Application secret ID associated with the user.
refresh_tokenThis is the refresh token that is returned when the access token is generated.
  1. Once the valid values are set, save the environment, and set the HPE Aruba Networking Central ENV as the active environment for your workspace.
  2. Click on the Collections tab and select HPE Aruba Networking Central collection. Within the collection, go to Refresh Token collection in Token Management.
  3. Click on Run to open this collection's runner. You don't have to make any changes to run options.
  4. Click on Run HPE Aruba Networking Central.

This collection runner will make the Refresh API call. You can check with Postman console to see the status of the collection runner. If successful, the access_token and refresh_token will be refreshed and updated in HPE Aruba Networking Central ENV environment.

Step to

Step to use Refresh Token collection runner

Delete Token (Non-SSO Users)

Once you no longer need an access token, you can use the Delete API to revoke the access token. This API call only be used for access tokens that were generated via OAuth APIs. You can follow the below steps to use the Delete Token collection runner to delete access tokens:

  1. Within your personal workspace, select the Environments tab and add values for the following variables in the HPE Aruba Networking Central ENV:
VariableDescription
base_urlDomain Base URL for HPE Aruba Networking Central API Gateway based on the geographical cluster where your account is registered.
access_tokenAccess Token that needs to be deleted.
csrf_token & session_tokenThese are the session variables that were returned in Login step of OAuth APIs.
  1. Once the valid values are set, save the environment, and set the HPE Aruba Networking Central ENV as the active environment for your workspace.
  2. Click on the Collections tab and select HPE Aruba Networking Central collection. Within the collection, go to Delete Token (Non SSO Users) collection in Token Management.
  3. Click on Run to open this collection's runner. You don't have to make any changes to run options.
  4. Click on Run HPE Aruba Networking Central.

This collection runner will make the Delete API call. You can check with Postman console to see the status of the collection runner. If successfully, the access token will be revoked and the following variables will be removed from HPE Aruba Networking Central ENV environment: access_token, refresh_token csrf_token, session_token

Steps to use Delete Token collection runner

Steps to use Delete Token collection runner