Skip to content

Instantly share code, notes, and snippets.

View arnklint's full-sized avatar
😀
writing status

Jonas Arnklint arnklint

😀
writing status
View GitHub Profile
/*
Install this script as a pre-request Script on your Postman collection.
Define Auth_Url, and Basic_Auth as local variables on the collection.
Define OAuth_Token, OAuth_Timestamp, ExpiresInTime, OAUTH_USERNAME, OAUTH_PASSWORD and OAUTH_REFRESH_TOKEN
in the associated Postman environment.
*/
var tokenDate = new Date(2010, 1, 1);
var tokenTimestamp = pm.environment.get("OAuth_Timestamp");
if (tokenTimestamp) {
tokenDate = Date.parse(tokenTimestamp);