Type of Variables
There are generally two types of variables supported in Postman default and secret.
1. Default Variables
This is the default type of all the variables in Postman, it is automatically assigned when a variable is declared. In this type, the variables are presented in the plain text form normally and don’t have extra properties. You can create default variables in the Postman app by going to the “Variables” tab in the sidebar and adding the desired variables.
2. Secret Variables
This type of variable was introduced in Postman to protect the disclosure of sensitive data in some scenarios. Secret variables hide the initial and current values of the variables for all the workspace members. If the user doesn’t want to disclose some parts of the data during testing then he/she can declare the variable as secret.
Follow the below steps to create a secret variable in Postman:
Step 1: Click on the Environments tab.
Step 2: Click on Globals.
Step 3: Under globals, all variables will be visible. Click on the type of variable you want to make a secret and select the secret option from the dropdown.
Step 4: Now you will see your data will be hidden and your crucial information will not be disclosed if the variable is declared as a secret variable.
Note: It’s important to note that while regular variables are visible in the Postman UI, secrets are kept confidential and are not displayed in the Postman app.
How to Create Variables in Postman with Different Scopes
If you use Postman for testing your APIs and want to learn how to declare variables in it then this article is going to be helpful for you. In this article, you will learn how you can declare variables in Postman step by step. You will also learn about the various scopes of variables, their types, and their use cases in different scenarios. So deep dive into this article and master the variables in Postman.