|
|
|
ส่ง Img เข้า line notify ไม่ได้ ช่วยหน่อยครับ ส่งข้อความปกติได้ครับแต่ส่งรูปไม่ได้ |
|
|
|
|
|
|
|
Code
$token='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$message="\nทดสอบการส่ง Line";
$imageFile= new CURLFILE('img.jpg');
$sticker_package_id = ''; // Package ID sticker
$sticker_id = ''; // ID sticker
$message_data = array(
'message' => $message,
'imageFile' => $imageFile,
'stickerPackageId' => $sticker_package_id,
'stickerId' => $sticker_id
);
$line_api = 'https://notify-api.line.me/api/notify';
$headers = array('Method: POST', 'Content-type: multipart/form-data', 'Authorization: Bearer '.$token );
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $line_api);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $message_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
Tag : PHP, Ajax, jQuery
|
|
|
|
|
|
Date :
2023-06-26 23:32:04 |
By :
aimoomoo |
View :
1902 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|