📘

line notifyにメッセージを送るgasの関数

2022/01/03に公開
//line notifyのtokenを入れる
const NOTIFY_TOKEN = "";

// line notifyに送信する関数
function notifyToLine(message){
 let options = {
   "method" : "post",
   "headers" : {
     "Authorization" : "Bearer "+ NOTIFY_TOKEN
   },
   "payload" : {
     "message" : message
   }
 }

 let url  = "https://notify-api.line.me/api/notify"
 UrlFetchApp.fetch(url, options)
}

Discussion