解決しました。
- 0
phpより「message/nulticast」にてメッセージを送信したい
RETURN:{"message":"The property, 'to[0]', in the request body is invalid (line: -, column: -)"}
php------------------- $url = "https://api.line.me/v2/bot/message/multicast";
$msg = array ( array( "type" => "text", "text" => "hello" ) ); $aa = "{userid}"; $data = array( 'to' => array ( $aa ), 'message' => $msg ); $data = json_encode($data);
curl-----------
curl -v -X POST https://api.line.me/v2/bot/message/multicast
-H 'Content-Type: application/json'
-H 'Authorization: Bearer {access_Token}'
-d '{
"to": ["{userid}"],
"messages":[
{
"type":"text",
"text":"hello"
}
]
}'
上記、{access_Token}、{userid}は同一のものを使用、curlでは送信可能、phpではエラーとなる