Skip to content

LINE Notify API Node

Jatu Tung edited this page Jan 16, 2023 · 50 revisions

notify-node

NODE-RED node for publish message notification to LINE Notify. You can use LINE notify API through this Node, include uploading image file.

Three types of messages can be sent.

  1. Text
  2. Images
  3. Sticker

Two modes of usage node can be set.

  1. Manual input data
  2. Use data from flow

Initial usage

  1. Create and obtain an Access Token at LINE Notify official website.

  2. Add LINE Notify Node in Node-RED workspace.

Node settings

Configure nodes before use.

  1. Setup Access Token at LINE Notify API Node.

Access token

  1. Determined that user doesn't receive or receives Push Notification at LINE Notify when the message is sent.

line push notification

setting push notification

  • Check : user doesn't receive Push Notification
  • Uncheck : user receives Push Notification
  1. Choose usage data from flow or manual input data.

select mode

  • Check : Use data from flow
  • Uncheck : Use data from manual input (default)

Manual input data mode

Default mode. Using data from manual input for publish message to LINE Notify.

Inputs

Tab [ Message ]

tab message

Inputs Mandatory Type Description
Message Yes string message to publish. 1000 characters max

Addtional emoji picker for text message tab.

emoji-picker 1

emoji-picker 2

Tab [ Image ]

tab image

Inputs Mandatory Type Description
Fullsize URL Yes (if choose Image URL option) string image fullsize URL to publish. Maximum size of 2048×2048px JPEG
Fullsize URL Yes (if choose Image URL option) string image thumbnail URL to publish. Maximum size of 240×240px JPEG
Upload Image Yes (if choose Upload Image option) string image to upload. Should be an absolute path to upload image file, e.g. C:\folder\image.jpg (Support .png and .jpg)

Remark : Inputs 'Not use', 'Image URL' and 'Upload Image' have only one option able to use. So if choose one option, then other options have been cancelled.

Tab [ Sticker ]

tab sticker

Inputs Mandatory Type Description
Use Sticker Yes boolean specify true/false to publish sticker to LINE Notify.
Package ID Yes (if choose Use Sticker option) number LINE Package Id of sticker Id.
Sticker ID Yes (if choose Use Sticker option) number LINE Sticker Id.

Outputs

output properties is underneath msg object.

1. Standard output

Property Type Description
status number standard result status code
payload string result message

2. Standard error

Property Type Description
status number standard error code
payload string standard error message

Use data from flow mode

Using data from flow for publish message to LINE Notify

Inputs

msg object is main used for this LINE Notify node. All input properties is underneath msg object. Such as, msg.payload.

Property Mandatory Type Description
payload Yes string the payload of the message to publish. 1000 characters max
useImageUrl No boolean specify true/false to publish image URL to LINE Notify.
imageFullsizeUrl No string image fullsize URL to publish. Maximum size of 2048×2048px JPEG
imageThumbnailUrl No string image thumbnail URL to publish. Maximum size of 240×240px JPEG
useImageFile No boolean specify true/false to use upload a image file to the LINE server.
imageFile No string image to upload. Should be an absolute path to upload image file, e.g. C:\folder\image.jpg (Support .png and .jpg)
useSticker No boolean specify true/false to publish sticker to LINE Notify.
stickerId No number LINE Sticker Id. See more details at LINE List of available stickers
stickerPackageId No number LINE Package Id of sticker Id. See more details at LINE List of available stickers

Detail :

  • msg.useImageUrl is optional. If it does not sent from flow, this means not publish image url to LINE Notify. Likewise, if msg.useImageUrl is true, msg.imageFullsizeUrl and msg.imageThumbnailUrl must be specified.

  • msg.useImageFile is optional. If it does not sent from flow, this means not upload image file to LINE server. Likewise, if msg.useImageFile is true, msg.imageFile must be specified.

  • If you specified all msg.imageFullsizeUrl, msg.imageThumbnailUrl and msg.imageFile, the msg.imageFile takes precedence. See more detail at LINE Notify API Document

  • msg.useSticker is optional. If it does not sent from flow, this means not publish sticker to LINE Notify. Likewise, if msg.useSticker is true, msg.stickerId and msg.stickerPackageId must be specified.

Outputs

output properties is underneath msg object.

1. Standard output

Property Type Description
status number standard result status code
payload string result message

2. Standard error

Property Type Description
status number standard error code
payload string standard error message

Examples usage

After install package, see usage examples at Node-RED Import menu at node-red-contrib-node-line-api, then line-notify-examples.

More details