実現したいこと
https://velleity-note.blog/web-service/gmail-line/
↑のサイトを参考に設定を行いましたがエラーが出ます。
どのようにすれば良いでしょうか?
初心者です。すみません。専門用語はわかりませんすみませんが宜しくお願い致します
発生している問題・分からないこと
https://velleity-note.blog/web-service/gmail-line/
↑のサイトを参考に設定を行いましたがエラーが出ます。
どのようにすれば良いでしょうか?
初心者です。すみません。専門用語はわかりませんすみませんが宜しくお願い致します
エラーメッセージ
error
1Exception: Request failed for https://notify-api.line.me returned code 400. Truncated server response: {"status":400,"message":"message: must not be empty"} (use muteHttpExceptions option to examine full response) 2send_line @ コード.gs:10
該当のソースコード
var lineToken = "xxxxxxxxxxxxxxxxxxx"; //LINE Notifyのトークン function send_line(Me) { var payload = { 'message': Me }; var options = { "method": "post", "payload": payload, "headers": { "Authorization": "Bearer " + lineToken } }; UrlFetchApp.fetch("https://notify-api.line.me/api/notify", options); } function fetchContactMail() { var ISREAD_LABEL = GmailApp.getUserLabelByName('通知済み'); var strTerms = ('label:通知対象 -label:通知済み'); var myThreads = GmailApp.search(strTerms); var myMsgs = GmailApp.getMessagesForThreads(myThreads); var valMsgs = []; for (var i = 0; i < myMsgs.length; i++) { valMsgs[i] = "\n■" + myMsgs[i].slice(-1)[0].getSubject() + "\n" + myMsgs[i].slice(-1)[0].getPlainBody().slice(0, 100) + "\n" + myMsgs[i].slice(-1)[0].getFrom(); } myThreads.forEach(function (t) { t.addLabel(ISREAD_LABEL); }); return valMsgs; } function main() { new_Me = fetchContactMail() if (new_Me.length > 0) { for (var i = new_Me.length - 1; i >= 0; i--) { send_line(new_Me[i]) } } }
試したこと・調べたこと
- teratailやGoogle等で検索した
- ソースコードを自分なりに変更した
- 知人に聞いた
- その他
上記の詳細・結果
同様の質問が出てきませんでした。
補足
特になし

回答1件
あなたの回答
tips
プレビュー