Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is {{$guid}} used for in Postman?

Postman's official website states that Postman has a few dynamic variables. My question is about:

{{$guid}}: Adds a v4 style guid

What kind of variable is {{$guid}}? How can it be used in test scripts for API requests?

like image 261
Nurlan Mirzayev Avatar asked Jun 16 '16 06:06

Nurlan Mirzayev


People also ask

How do I give my Postman a GUID?

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.

What is GUID in API?

GUID stands for Global Unique Identifier. A GUID is a 128-bit integer (16 bytes) that you can use across all computers and networks wherever a unique identifier is required.

What is GUID generator?

A GUID (globally unique identifier) is a 128-bit text string that represents an identification (ID). Organizations generate GUIDs when a unique reference number is needed to identify information on a computer or network. A GUID can be used to ID hardware, software, accounts, documents and other items.


Video Answer


1 Answers

GUID is the acronym for "Globally Unique Identifier". A GUID is mainly used to produce hexadecimal digits with groups separated by hyphens for uniqueness purposes, for example:

b3d27f9b-d21d-327c-164e-7fb6776f87b0

In postman you can use this to generate and send a random GUID to your api as required:

{     "id": "{{$guid}}", } 

On Send would produce(with the random example above):

{     "id": "b3d27f9b-d21d-327c-164e-7fb6776f87b0", } 
like image 133
Shaun McHugh Avatar answered Sep 19 '22 20:09

Shaun McHugh