Using Environments in Postman
Environments are essentially a collection of variables. Most of mine contain:
* API credentials, either a token or a username/password
* Base URLs so I can change which platform I’m targetting
The controls for Environments are in the top left, no down a little, that’s it! A dropdown, an eye, and a settings cog :)
You can set up different Environments for test/live platforms, for different geographical regions, or whatever you need. I use “Lorna Nexmo” for my live Nexmo credentials and API base URLs, and “Prism” for when I’m using prism as a local mock version of an API. Switching between the two becomes very quick and convenient, and I find it a real timesaver!
Once you have variables set up in an Environment, it makes it very easy to use them whenever you need them. This is great because I don’t have to keep looking up credentials every time I want to add them to a request. I can just type {{
and see what autocompletes!
Such a simple feature but very handy. Also, see in the screenshot it previews the values? I can use the “Prism” Environment so that I don’t display my actual credentials when I’m streaming/speaking/blogging, and then just flip it in the Environments dropdown. Very useful!
Also published on Medium.