実現したいこと
LINE messsageAPIを使用し、複数ユーザーに一括メッセージ送信をしたい
前提
・multicast APIが使用可能と確認済
・スプレッドシートの情報取得、ユーザーIDそのものは取得できています。
発生している問題・エラーメッセージ
Request failed for https://api.line.me returned code 400. Truncated server response: {"message":"The property, 'to[0]', in the request body is invalid (line: 1, column: 8)"} (use muteHttpExceptions option to examine full response)
該当のソースコード
javascript
1function multiUser() { 2 3//最終行数を取得し、メッセージ内容を取得 4 let lastRowNo = testSheet.getLastRow(); 5 let value = testSheet.getRange(lastRowNo, 5, 1, 1).getValues(); 6 console.log(value); 7 let users = idSheet.getRange(1,2,idSheet.getLastRow(),).getValues(); 8 console.log(users); 9 10 UrlFetchApp.fetch('https://api.line.me/v2/bot/message/multicast', { 11 method: 'post', 12 headers: { 13 'Content-Type': 'application/json', 14 'Authorization': 'Bearer ' + CHANNEL_ACCESS_TOKEN, 15 }, 16 payload: JSON.stringify({ 17 "to": users, 18 "messages":"messages": [{ 19 type: 'text', 20 text: value 21 }), 22 }); 23 testSheet.getRange(lastRowNo, 1).setValue(getCurrentTime()); 24 25 }
試したこと
JavaSscript内のチャンネルトークン、LINE Developersに貼り付けるWebhook URLに間違いがないか何度も確認しました。
ユーザーIDを直接打ち込んで試してみたりもしました。

回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
また依頼した内容が修正された場合は、修正依頼を取り消すようにしましょう。