Lotify is a LINE Notify client SDK that you can build Notify bot quickly.
You need a LINE account and create a Notify: Link
composer require eric0324/lotify
use Ericwu\Lotify\Lotify;
$channelSecret = "<YOUR_CHANNEL_SECRET>";
$clientId = "<YOUR_CLIENT_ID>";
$redirectUri = "<YOUR_REDIRECT_URI>";
$lotify = new Lotify([
'channelSecret'=> $channelSecret,
'clientId' => $clientId,
'redirectUri' => $redirectUri
]);
$link = $lotify->getAuthLink('<RANDOM_STRING>');
echo($link);
# https://notify-bot.line.me/oauth/authorize?scope=notify&response_type=code&client_id=QxUxF..........i51eITH&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fnotify&state=foo
$access_token = $lotify->getAccessToken('<NOTIFY_RESPONSE_CODE>');
echo($access_token);
# N6g50DiQZk5Xh...25FoFzrs2npkU3z
$status = $lotify->getStatus('<YOUR_ACCESS_TOKEN>');
echo($status);
# {'status': 200, 'message': 'ok', 'targetType': 'USER', 'target': 'Eric wu'}
$response = $lotify->sendMessage(access_token='<YOUR_ACCESS_TOKEN>', message='<This is notify message>');
echo($response);
# {'status': 200, 'message': 'ok'}
You can find stickerId and stickerPackageId here
$response = $lotify->sendMessageWithSticker('<YOUR_ACCESS_TOKEN>', '<This is notify message>', '<sticker_id>', '<sticker_package_id>');
echo($response);
# {'status': 200, 'message': 'ok'}
$image = $lotify->sendMessageWithImageUrl(
'<YOUR_ACCESS_TOKEN>',
'<This is notify message>',
'<IMAGE_THUMBNAIL_URL>',
'<IMAGE_FULLSIZE>',
);
echo($image);
# {'status': 200, 'message': 'ok'}
$revoke = $lotify->revoke('<YOUR_ACCESS_TOKEN>');
echo($revoke);
# {'status': 200, 'message': 'ok'}
MIT © Eric Wu