Skip to content

Instantly share code, notes, and snippets.

@sandeepb1
Created July 21, 2020 20:02
Show Gist options
  • Save sandeepb1/c4aa19f0ecd84dd94917730f92599814 to your computer and use it in GitHub Desktop.
Save sandeepb1/c4aa19f0ecd84dd94917730f92599814 to your computer and use it in GitHub Desktop.
PatchContent.js
var req = new Script.Util.HttpRequest(endpoint);
req.emptyContentHandling = 0;
req.retries = 2;
req.continueOnError = true;
req.setHeader("Authorization", "Bearer " + accessToken);
req.contentType = "application/json"
req.method = "PATCH";
req.postData = Stringify(payload);
var response = req.send();
Write(Stringify(response.content));
stringifiedCreatedAssets = Platform.Function.Stringify(response);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment