Bruno is an API client tool very similar to Postman. It’s open source, file based and offline only. Your data resides on your device. It comes as standalone desktop app, CLI tool and a VSCode extension for syntax checking .bru files.
The website can be found here: https://www.usebruno.com/
Porting your ISC Postman collection is a a five minute task. Here is a quick guide on how to port the V3 collection from Postman to Bruno Desktop app.
-
Download and install the desktop app from here: Downloads
-
Export one of the ISC collections (e.g. V3) from Postman:
- Import the collection into Bruno (chose Postman collection during import dialogue)
- Under Collection Settings, set the Auth type to “No Auth” and paste the following Pre Request script into the Script setting:
const axios = require("axios");
const clientId = bru.getEnvVar("clientId");
const clientSecret = bru.getEnvVar("clientSecret");
const baseUrl = 'https://' + bru.getEnvVar("tenant") + '.api.' + bru.getEnvVar("domain") + '.com';
const tokenUrl = baseUrl + '/oauth/token';
console.log("Entering collection pre-request script");
if (!bru.getEnvVar("baseUrl")) {
console.log("Initialising baseUrl");
bru.setEnvVar("baseUrl",baseUrl);
}
var moment = require("moment");
if (!bru.getEnvVar("tokenExpTime")) {
console.log("Initialising tokenExpTime");
bru.setEnvVar("tokenExpTime",moment());
}
if (moment(bru.getEnvVar("tokenExpTime")) <= moment() || !bru.getEnvVar("tokenExpTime") || !bru.getEnvVar("accessToken") ) {
var time = moment();
time.add(12, 'hours');
bru.setEnvVar("tokenExpTime", time);
try {
console.log("Requesting Access Token");
let response = await axios({
method: 'POST',
url: tokenUrl,
headers: {
'Content-Type': 'multipart/form-data',
},
data: {
grant_type: 'client_credentials',
client_id: clientId,
client_secret: clientSecret
},
});
bru.setEnvVar("accessToken", response.data.access_token);
} catch (error) {
throw error;
}
} else {
console.log("No need to renew");
}
- Configure a new environment with the following Variables (You only need to enter valid values for domain, clientId, clientSecret, and tenant.
The others will be set in the Pre-Request script.) :
- Pick a request and execute:
Have fun with Bruno.