Testing Rest API Calls Using Postman

You can use a third party application called Postman to create a test environment for testing calls to the Engaging Networks REST API services.

You can download Postman for free from https://www.getpostman.com/downloads/

In the video below we walk you through the process of making calls from within the Postman application

Postman session token variable script

Creating an environment variable to store the session token when you authenticate with the REST API helps speed up the testing and development process

Add the script below to the ‘Tests’ tab of your authentication call to automatically set the environment variable en_token with the session token.

var jsonData_str = responseBody.replace("-","");
var jsonData = JSON.parse( jsonData_str.replace("auth-","_") );
postman.setEnvironmentVariable( "en_token", jsonData.ens_token );
postman.setEnvironmentVariable( "en_timestamp", Date.now());
postman.setEnvironmentVariable( "en_firstName","John");
postman.setEnvironmentVariable( "en_lastName","Doe");

API Syntax

The full syntax of our API can be reviewed at http://bitly.com/ens_services

Updated on December 21, 2021

Was this article helpful?

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support