-
Notifications
You must be signed in to change notification settings - Fork 0
LINE Message API Reply Message Node
NODE-RED node for reply message to LINE Messaging API channel.
-
Create LINE Messaging API Channel in LINE Developer console. Use this official document Getting started with the Messaging API to create your own LINE Messaging API.
-
Obtain a Channel Access Token and Channel Secret from your created LINE Messaging API Channel (Actually, LINE Message API Reply Message Node use only Channel Access Token, but LINE Messaging API Configuration Node requires both Channel Access Token and Channel Secret for configuration).
-
Add Messaging API Channel to LINE application.
-
Add LINE Message API Reply Message Node in Node-RED workspace. Normally, LINE Message API Reply Message Node use with LINE Webhook Node for automatic reply when Webhook tricked. Morever, LINE Message API Reply Message Node uses
replyToken
for reply message. So, using LINE Message API Reply Message Node with LINE Webhook Node are easier than use single LINE Message API Reply Message Node. -
Configure LINE Messaging API Channel Access Token and Channel Secret in Reply Message Node. See using LINE Messaging API Configuration Node
- Setup Node values
-
Use/Don't Use Reply Token from wired node. If use reply Token from wired node, it does not use Reply Token from Node Input.
You can findreplyToken
for reply message by go to How to find User Id, Group Id or replyToken for testing Messaging API at solution NO 2.
Remark : The replyToken come with the request will only valid for about 30 seconds. See reference
- Use/Don't use Message data from wired node. If use message data from wired node, it does not use message type and message content from Node Input.
-
Message Type, Normal Text (
string
) or Custom Message Format (JSON
) - Message, message for reply.
- Disabled Push Notification, the user does/doesn't receive push notification when the message is sent.
-
Run workflow
-
Check result.
When setup node values to 'Use Reply Token from wired node', it uses msg
object instead node input.
Property | Mandatory | Type | Description |
---|---|---|---|
replyToken | No (Yes, if select 'Use Reply Token from wired node') | string |
Specified Reply Token value for reply message to. |
When setup node values to 'Use message data from wired node', it uses msg
object instead node input.
Property | Mandatory | Type | Description |
---|---|---|---|
messageType | No (Yes, if select 'Use Message data from wired node') | int |
0 : for normal text message for reply message.1 : for custom message format for reply message. |
payload | No (Yes, if select 'Use Message data from wired node') |
string or JSON
|
string : for normal text messageJSON : for custom message formatPayload reply message is validated at runtime. |
Result from reply message by using msg
object.
Property | Type | Description |
---|---|---|
status | number |
Result status code |
payload | string |
Result status message |
- Output success case
status = 0 payload = Reply message success: {"x-line-request-id":"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"}
Remark : {"x-line-request-id":"xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx"} is result from LINE Messaging API response.
- Output Fail case
status = <Error Number> payload = <Error message>
After install package, see usage examples at Node-RED Import menu at node-red-contrib-node-line-api
, then line-reply-message-examples
. There are using 'function' node for managing events message from LINE Webhook Node too.
- See more details at LINE Messaging API (Send reply message) Document.
- See more details about Custom message format at LINE Message Types.
- See more details at List of available LINE emojis.
- Node has paste function data from clipboard, so allow paste permmision in browser to able to work paste function.