Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Created February 28, 2020 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuzannamj/5444c98baf71f9ef0118ab0cc71cba0e to your computer and use it in GitHub Desktop.
Save zuzannamj/5444c98baf71f9ef0118ab0cc71cba0e to your computer and use it in GitHub Desktop.
var headerNames = ["Authorization"];
var headerValues = ["Bearer " + accessToken];
var jsonBody = {
"name": fileName,
"assetType": {
"name": assetName,
"id": assetTypeID
},
"file": base64enc
};
var requestUrl = rest_instance_url + "asset/v1/content/assets"
var createAsset = HTTP.Post(requestUrl, contentType, Stringify(jsonBody), headerNames, headerValues);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment