Skip to content

osu-mist/postman-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 

Repository files navigation

Postman Tools

Settings and code to make the most of Postman.

Auto-Authentication Setup

  1. Create all the environments you need. These can be named anything you see fit Open environment settings
  2. These environments only need two variables
    • URL
    • authType (must be one of the following):
      • bearer
      • basic Local environment example
  3. Add the 'URL' variable to the url of all your requests URL example
  4. Create a top level collection to hold all of the APIs you want to use auto-authentication Collection example
  5. Edit the collection and add the following variables in the Variables tab. Note the names matter here since they are referenced in the script. Also make sure that the Current Value column is filled in since this is what the script uses.
    • bearerToken (Can be left blank)
    • tokenExpirationDate (Can be left blank)
    • clientId (oauth2 client Id)
    • clientSecret (oauth2 client secret)
    • username (basic auth username)
    • password (basic auth password) collection variables
  6. Copy 'authentication-pre-request.js' and paste it in the 'Pre-request Scripts' tab pre-request scrip
  7. Make sure 'Authorization' for all of your requests are set to 'No Auth'. The pre-request script will handle this setting. The easiest way to do this is to set the top level collection to 'No Auth' and leave all others at their default value of 'Inherit auth from parent'. authorization example
  8. Make a request! Check the Postman console if errors occur.

Handling Versions

There are multiple ways to handle version numbers in postman but using global variables looks to be the simplest. You can access global variables by clicking the 'eye' symbol in the top right of the postman window. global variables button Click the Edit link in the Globals section and add a version variable. Then add the version variable in place of the version number. version url example You can edit the version number on the fly by hitting the eye button again and hovering over the Current Value which will show an edit symbol. version editing

About

Settings and code to make the most of Postman

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published