Skip to content

Instantly share code, notes, and snippets.

Last active October 1, 2020 13:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
<script runat="server">
var authEndpoint = '';
var payload = {
clientId: "insert Client Id",
clientSecret: "insert Client Secret"
var url = authEndpoint + '/v1/requestToken';
var contentType = 'application/json';
try {
var accessTokenRequest = HTTP.Post(url, contentType, Stringify(payload));
if(accessTokenRequest.StatusCode == 200) {
var tokenResponse = Platform.Function.ParseJSON(accessTokenRequest.Response[0]);
var accessToken = tokenResponse.accessToken;
} catch (error) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment