REST API Articles - Page 7 of 5

How to use dynamic GUID in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:21:23

4K+ Views

We can use dynamic GUID in Postman. This can be utilized in the request URL, Body or Headers by simply adding the value {{$guid}}. It does not need any declaration or initialization.Thus {{$guid}} can be used directly in Postman without any requirement of prior processing of the variable. Postman has support for dynamic variables. GUID is one such instance.We need not allocate memory or value for this variable. The syntax is {{$guid}}. Besides GUID, there are other dynamic variables like randomInt, timestamp, and so on in Postman.Usage of Dynamic GUID in URLUrl − https://www.tutorialspoint.com/index.htm?n={{$guid}}The above image shows the usage of ... Read More

Manually Generating GUID in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:20:45

3K+ Views

We can manually generate GUID in Postman with the help of the steps listed below −Step1 − Input the endpoint − https://www.tutorialspoint.com/index.htm in the address bar.Step2 − Add the below script under the Pre-request Script tab −var u= require('uuid') var ud = u.v4() console.log(ud)In the above script, require is used in JavaScript for loading a module. Then, the version 4 of the GUID is stored in the variable ud. Finally, the generated GUID is printed in the console.It must be remembered that we cannot use a variable with name guid within a Pre-request Script in Postman. However, the guid can ... Read More

GUID in Postman

Debomita Bhattacharjee
Updated on 25-Jun-2021 16:26:40

1K+ Views

GUID means Global Unique Identifier. It is in the form of a hexa-decima digit which is separated by hyphen. It helps to achieve distinctiveness due to this even if multiple people are creating the GUID simultaneously, the chance of having a duplicate GUID is rare.To generate a random value, using GUID, the format is −{    "name": "{{$guid}}" }On sending a request, it would produce a random value.GUID is a value with 128 bits having a structure defined in RFC4122. The structure of GUID is uncomplicated and simple for generation.The format of a GUID is shown below −xxxxxxxx-xxxx-Axxx-Bxxx-xxxxxxxxxxxxHere, A is ... Read More

What are Scripts In Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:17:51

801 Views

Postman is developed on Node.js that gives dynamic characteristics to Collections and requests. We can create test suites, execute requests having changing parameters, send data in between requests, and so on.A JavaScript can be associated with a request twice. Once before the actual request has been sent(as a pre-condition script added under the Pre-Request Scripts tab)and after the Response from the request has been received (as a test script added under the Tests tab).Let us send a GET request along with Pre-Request and Test scripts.Pre-Request Script −console.log("Tutorialspoint - Postman")Testsconsole.warn("Warning message in console") console.log("Logging message in console") console.info("Info message in console") ... Read More

Mobile

How to Generate API Documentation in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 12:52:12

576 Views

We can generate API Documentation in Postman. This is done by most of the companies to help the developers in understanding the behavior of an API and guide them. An API is usually created for internal use and for third party developers.The steps to create an API Documentation are given below −Step1 − Click on the arrow to the right of the Collection name in the sidebar. Then click on Add a description.Step2 − An input field shall come up. Type a description then click on the Save button.Step3 − Click on the three dots beside the Run button. Then ... Read More

What is Postman Sandbox?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:08:06

884 Views

Answer − Postman Sandbox is an Environment provided to execute JavaScript written as a part of the Pre-Request and Tests scripts for a request. This can be available for both Postman and Newman. Thus every script developed under the Tests or Pre-Request Scripts tab can be executed within this Sandbox.Libraries and Utilities used in Postman Sandbox −Lodash - a utility in the JavaScript library.cheerio.BackboneJS.SugarJS.CryptoJS.Environment, Global, Dynamic variables & CookiesTo set an Environment variable, we have to add the below script −postman.setEnvironmentVariable(name of variable, value of variable)To set a Global variable, we have to add the below script −postman.setGlobalVariable(name of variable, ... Read More

How to Share Session ID across Different Requests in Postman?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:05:36

2K+ Views

We can share session id across different requests in Postman. We can send a cookie value obtained from a request to a different request. This can be done only if the website is similar.A particular server can identify its own cookie. This makes a cookie highly secured. The cookies are passed to another request to store the information of the user preferences as it navigates through the webpages.A session id is similar to an expiration of a token. As the session id gets expired, an user has to again authenticate his credentials. As a user logs in for the first ... Read More

How to Monitor Collections in Postman?

Debomita Bhattacharjee
Updated on 24-Jun-2021 15:25:36

300 Views

A Postman Monitor is used to execute a Collection within the Postman cloud. It is used to determine the condition and the performance of the APIs.Monitors in Postman are designed on Collections.Monitors can be set up as frequently as every five minutes and can be configured with all the requests in a Collection. Also, there is an option to append Environment variables for the running of a Collection.Let us see how to create a Monitor Collection.Step1 − Click on the arrow beside the Collection name in the sidebar. Then click on Monitors.Step2 − Click on Create a Monitor. It is ... Read More

Advertisements