Building the client library requires:
- Node.js - Installation
⚠️ Make sure that there is also added a variable to the PATH: Node.js - Environment Setup.
To copy the client to your computer copy link of the repository, open Command Prompt, go to the location where project will be copied and execute git clone command:
git clone https://github.com/kyriba/dev-portal-basic-JavaScript-Postman-App-sample.git
Open the project folder via command prompt, for example:
cd dev-portal-basic-JavaScript-Postman-App-sample
Select the desired Collection in Postman, authenticate through "Get token." request and run the request that you want to provide in the Application. If the request works, copy code from Postman:
In "Code snippet", proceed to the dropdown list with different programming languages, where "cURL" is set by default, and choose "JavaScript - XHR" from the list. There, copy the snippet to clipboard:
Open the .../App.js file with any text redactor and input your piece of code:
If you would like to display the response body in the Terminal in a more readable format, please replace the console.log(this.responseText);
line of code with:
console.log(JSON.stringify(JSON.parse(this.responseText), null, 2));
Run the project in Terminal in the root folder of cloned app:
node App.js
If everything was done accordingly with provided steps, you will get the result printed in the command prompt.