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?
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.
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.
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.
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", }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With