Line Notify する Google Apps Script
var token = PropertiesService.getScriptProperties().getProperty("LINE_TOKEN"); function main(){ var message = "お知らせ"; notify(message); } function notify(message){ var options = { "method" : "post", "payload" : "message=" + message, "headers" : {"Authorization" : "Bearer "+ token} }; UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options); }
Line Nofify の Access Token は
File メニュー
> Project Properties
> Script Properties タブ
で LINE_TOKEN
を追加して設定する。