Skip to content

Instantly share code, notes, and snippets.

@yehara
Last active September 23, 2021 15:47
Show Gist options
  • Save yehara/9339588 to your computer and use it in GitHub Desktop.
Save yehara/9339588 to your computer and use it in GitHub Desktop.
Google Apps Script から multipart/form-data でファイルを送信する(2)
function request () {
var encodedFilename = "=?UTF-8?B?" + Utilities.base64Encode("ファイル名.csv", Utilities.Charset.UTF_8) + "?=";
var payload = {
"processModelInfoId": "1",
"nodeNumber": "1",
"key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"title": "件名をここに",
"data[0].upload": Utilities.newBlob("ファイル本文をここに", "text/csv; charset=UTF-8", encodedFilename)
};
var options = {
"method" : "post",
"payload" : payload
};
UrlFetchApp.fetch("https://YYYYYYYY.questetra.net/System/Event/MessageStart/start", options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment