With Postman, environment variables are defined within three different scopes:
Global
: Variables in this scope are accessible globally in Postman.Environment
: The variables' value in the scope depends on the selected environment.Collection
: The variable is embedded in the collection itself. Any API defined in the collection can access that value.
If you need to export your collection with its variables, the only option is to use
Collection
variable. If you're usingEnvironment
scoped variables, you have to export those variables in a separate JSON file.
Postman really stuffed up this feature, and the only way to achieve this is through the following twisted steps:
- Click on the
eye
icon next to the environment select box on the top right corner. - Click the freaking minuscule
edit
button in the top right corner. - Click the
Cancel
button (of course god damnit! That's definitely the button I would think clicking for an export). - Click in
download
icon next to your environment.