Install and Configure the Postman App
**Scope**
This article outlines how to install and configure the Postman App with the PBX API.
Requirements
-
OAuth Client ID and Client Secret (If you don't have this, create a support case)
-
Channel Partner Access to Manager Portal or higher
-
Existing Postman Account
Install Postman
Postman has a web version as well as a desktop app. This article outlines how to install Postman using the desktop app, but you may also skip this section and follow along using the web app.
- 1Navigate to the Postman home page
- 2To download the desktop app, click the icon for your matching operating system
3. Click Download the App
NOTE: You may need to select additional options for your particular operating system
4. Download and run the installation file to finish installing
5. Sign in to the app using your Postman credentials
Import the NS API Collection
- 1Open the Postman App
- 2Click Collections
3. Click Import
4. Click Link and enter this URL: https://<your FQDN>/ns-api/apidoc/api_doc_collection.json
5. Click Continue
6. Click Import
7. Right-click the collection to rename it if you wish

Add Environment Variables
- 1Click on Environments
2. Click the + sign to create a new environment
3. Enter a descriptive name
4. Add the following variables and values *ensure there is no typo's or linebreaks
| Variable | Initial Value |
|---|---|
| api_url | https://api.ucaasnetwork.com/ns-api |
| token_type | Bearer |
| createtokenpasswordoauth2_client_id | Your oauth2 client id |
| createtokenpasswordoauth2_client_secret | Your client secret |
| createtokenpasswordoauth2_username | Your portal username |
| createtokenpasswordoauth2_password | Your portal password |
| createtokenpasswordoauth2_grant_type | password |
- 1Click Save

Generate OAuth Token
- 1Click Collections
- 2Open the previously imported collection
3. Click the dropdown at the top right and select the newly created environment
4. Search for and select CreateTokenPasswordOauth2
5. 1. Click Scripts (1) then Click Post-res (2) followed by Send (3)
- 1Delete all of the code and replace it with the code below. This will allow us to save the access token as an environment variable for future use
pm.test("Generating access token", function () {
pm.response.to.have.status(200);
var token = JSON.parse(responseBody);
console.log('Access token is saved')
pm.environment.set("token", JSON.stringify(token) );
pm.environment.set("access_token", token.access_token);
});
- 1Click Save

- 1Click Send to test
2. If your credentials or your client_id/secret are invalid, then you will get an assertion error in the Test Results as shown below. (ie: Generating access token | AssertionError: expected response to have status code 200 but got 403 )
3. If everything went well, you will receive a JSON response with your access token, territory, username, etc.. letting you know that you have been authenticated successfully. You can verify the result at the bottom in the response field.
Note: This token is only valid for 60 minutes or 3600 seconds. Once the token has expired, you will have to send this query again
Related Articles
Was this article helpful?