2021年5月22日 星期六

[notify, send] How to send message using Line Notify

How to send messages using Line Notify

井民全, Jing, mqjing@gmail.com


Procedure

Step 1: Login to the My page (LINE account required)

https://notify-bot.line.me/my/


Step 2: Generate the Access Token to Line

Click [Generate token] button.


Result

Token: 4cdnPXWj0YiGZj0La3fJ35uFNhdFXBBwzMshajFlCvL

Step 3: Send message to the token

Command line

curl -X POST -H 'Authorization: Bearer [access_token]' -F 'message=foobar' https://  

notify-api.line.me/api/notify


Ex: Examples for sending two messages.

curl -X POST -H 'Authorization: Bearer 4cdnPXWj0YiGZj0shajFlCvL' -F 'message=foobar' https://notify-api.line.me/api/notify


curl -X POST -H 'Authorization: Bearer 4cdnPXWuFNhdFXBBwzMshajFlCvL' -F 'message=This is Jing 2.' https://notify-api.line.me/api/notify


Result




Reference

  1. https://engineering.linecorp.com/en/blog/using-line-notify-to-send-messages-to-line-from-the-command-line/#:~:text=You%20can%20generate%20your%20own,recognizable%20name%20for%20your%20token.