Skip to content

Instantly share code, notes, and snippets.

@jamesasu
Created August 6, 2019 22:49
Show Gist options
  • Save jamesasu/9ec1ebe41dfdfaa0419e2b5198551cac to your computer and use it in GitHub Desktop.
Save jamesasu/9ec1ebe41dfdfaa0419e2b5198551cac to your computer and use it in GitHub Desktop.
<script runat=server>
Platform.Load("core", "1.1.1");
var accessToken = {{yourToken}};
var url = 'https://www.exacttargetapis.com/asset/v1/content/assets/{{ContentID}}'
var payload = '{{yourPayload}}';
var auth = 'Bearer ' + accessToken;
var req = new Script.Util.HttpRequest(url);
req.emptyContentHandling = 0;
req.retries = 2;
req.continueOnError = true;
req.contentType = "application/json"
req.setHeader("Authorization", auth);
req.method = "PUT"; /*** You can change the method here ***/
req.postData = payload;
var resp = req.send();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment