Skip to content

Instantly share code, notes, and snippets.

@tmclnk
Last active April 7, 2022 14:39
Show Gist options
  • Save tmclnk/a9e4442b64346ed534685ca592e58ada to your computer and use it in GitHub Desktop.
Save tmclnk/a9e4442b64346ed534685ca592e58ada to your computer and use it in GitHub Desktop.
Postman - set authorization header
// Set environment variables from the response to the middleware login endpoint.
// These can be used with Authorization type "API Key" and the Authorization
// head "dmsi ContextID={{contextID}},Branch={{branch}}".
const jsonData = pm.response.json();
pm.environment.set("contextID", jsonData.data.attributes.sessionContextID)
pm.environment.set("branch", jsonData.data.attributes.initialBranch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment