Skip to content

Instantly share code, notes, and snippets.

@RayGHeld
RayGHeld / Postman_GetAccessToken_PreRequestScript
Created May 18, 2019 00:47
PreRequest Script for Postman to get an access token for a resouce using the client credentials flow
var client_id = pm.environment.get("client_id");
var client_sercret = pm.environment.get("client_secret");
var token_endpoint = pm.environment.get("token_endpoint");
var scope = pm.environment.get("scope");
pm.sendRequest({
url: token_endpoint,
method: 'POST',
header: {
'Content-Type': 'multipart/form-data',