myAdBanner

2021年9月9日 星期四

[google apps script function] send to line

// 把 token='xxxxxxx'; xxxxxx改成要用的 line token

function sendToLine(LineText) {
  var token='xxxxxxx';
  var options =
  {
      method  : "post",
      payload : "message=" + LineText,
      headers : {"Authorization" : "Bearer "token},
      muteHttpExceptions : true
  };  

  UrlFetchApp.fetch("https://notify-api.line.me/api/notify",options);

}