ScopeIntended Audience: Channel Partners or higherThis article outlines how to install and configure the Postman App with the PBX API.RequirementsOAuth Client ID and Client Secret (If you don't have this, create a support case)Channel Partner Access to Manager Portal or higherExisting Postman AccountInstall PostmanPostman 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.Navigate to the Postman home pageTo download the desktop app, click the icon for your matching operating systemClick Download the AppNOTE: You may need to select additional options for your particular operating systemDownload and run the installation file to finish installingSign in to the app using your Postman credentialsImport the NS API CollectionOpen the Postman App Click CollectionsClick ImportClick Link and enter this URL: https:///ns-api/apidoc/api_doc_collection.json Click ContinueClick ImportRight-click the collection to rename it if you wishAdd Environment VariablesClick on EnvironmentsClick the + sign to create a new environmentEnter a descriptive nameAdd the following variables and valuesVariableInitial Valueapi_urlhttps://api.ucaasnetwork.com/ns-apitoken_typeBearercreatetokenpasswordoauth2_client_idYour oauth2 client idcreatetokenpasswordoauth2_client_secretYour client secretcreatetokenpasswordoauth2_usernameYour portal usernamecreatetokenpasswordoauth2_passwordYour portal passwordClick SaveGenerate OAuth TokenClick CollectionsOpen the previously imported collectionClick the dropdown at the top right and select the newly created environmentSearch for and select CreateTokenPasswordOauth2Click TestsDelete 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 usepm.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);
});Click SaveClick Send to testIf 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 )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.  Click on Test Results to verify.This token is only valid for 60 minutes or 3600 seconds. Once the token has expired, you will have to send this query again