eric0324 / lotify
Lotify is a LINE Notify client SDK that you can build Notify bot quickly.
v1.0.1
2020-05-03 09:13 UTC
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2025-06-29 01:58:59 UTC
README
Lotify is a LINE Notify client SDK that you can build Notify bot quickly.
Usage
You need a LINE account and create a Notify: Link
Install package
composer require eric0324/lotify
Initialize instance
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 ]);
Get authorizer link
$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
Get access token
$access_token = $lotify->getAccessToken('<NOTIFY_RESPONSE_CODE>'); echo($access_token); # N6g50DiQZk5Xh...25FoFzrs2npkU3z
Get Status
$status = $lotify->getStatus('<YOUR_ACCESS_TOKEN>'); echo($status); # {'status': 200, 'message': 'ok', 'targetType': 'USER', 'target': 'Eric wu'}
Send message
$response = $lotify->sendMessage(access_token='<YOUR_ACCESS_TOKEN>', message='<This is notify message>'); echo($response); # {'status': 200, 'message': 'ok'}
Send message with Sticker
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'}
Send message with Image url
$image = $lotify->sendMessageWithImageUrl( '<YOUR_ACCESS_TOKEN>', '<This is notify message>', '<IMAGE_THUMBNAIL_URL>', '<IMAGE_FULLSIZE>', ); echo($image); # {'status': 200, 'message': 'ok'}
Revoke access token
$revoke = $lotify->revoke('<YOUR_ACCESS_TOKEN>'); echo($revoke); # {'status': 200, 'message': 'ok'}
License
MIT © Eric Wu