Node-red + Line Notify Massage
Node-red + Line Notify Massage
- check npm version , node version by command npm -v , node -v
- create inject by create massage string for send to Line Notify
- create function Set Line API
- For format Line massage Header
'content-type':'application/x-www-form-urlencoded','Authorization':'Bearer OKW0QlpccUbnkzyVKMqCwnPUELrxfVbPMs7LfGQjkSv'
By OKW0QlpccUbnkzyVKMqCwnPUELrxfVbPMs7LfGQjkSv is API KEY
can be generate by https://notify-bot.line.me/en/
And create massage to msg.payload
msg.payload = {"message":msg.payload};
- crate http request to flow
- by setting POST Method , URL to https://notify-api.line.me/api/notify
- create debug for view massage response
- if function complete Line Notify will show massage and debug
status":200,"message":"ok
clip board for copy to Node - red
[{"id":"4348851f.73393c","type":"inject","z":"23bed2c8.32ac2e","name":"","topic":"","payload":"Node-red send Line Massage","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":260,"wires":[["68b097b6.d92728"]]},{"id":"68b097b6.d92728","type":"function","z":"23bed2c8.32ac2e","name":"Set Line API ","func":"msg.headers = {'content-type':'application/x-www-form-urlencoded','Authorization':'Bearer OKW0QlpccUbnkzyVKMqCwnPUELrxfVbPMs7LfGQjkSv'};\nmsg.payload = {\"message\":msg.payload};\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":260,"wires":[["e0181699.102fc8"]]},{"id":"e0181699.102fc8","type":"http request","z":"23bed2c8.32ac2e","name":"","method":"POST","ret":"txt","url":"https://notify-api.line.me/api/notify","tls":"","x":600,"y":260,"wires":[["d64b9f9c.9ce57"]]},{"id":"d64b9f9c.9ce57","type":"debug","z":"23bed2c8.32ac2e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":820,"y":260,"wires":[]}]
hi what about sending image photo?
ReplyDelete