FruxonDocs

LINE

LINE Messaging API integration for answering customers in 1:1 chats and groups through a LINE Official Account

The LINE integration connects a LINE Official Account to Fruxon. Agents answer customers in 1:1 chats and in groups the account has been invited to, and can look up LINE profiles and check the account's message quota.

Prerequisites

You need a LINE Official Account with the Messaging API enabled, and two values from it:

  1. In LINE Official Account Manager, open your account and go to Settings → Messaging API. Enable the Messaging API and choose a provider.
  2. In the LINE Developers console, open the channel that was created.
  3. On Basic settings, copy the Channel secret.
  4. On the Messaging API tab, issue a Channel access token (long-lived) and copy it.

Then, in LINE Official Account Manager under Response settings, turn off Greeting message and Auto-response. Otherwise LINE answers alongside the agent.

To use the agent in group chats, turn on Allow bot to join group chats on the Messaging API tab.

Reissuing the channel secret or the long-lived token in the LINE Developers console invalidates the old one immediately. Update the Fruxon config at the same time, or inbound messages fail their signature check and replies are refused.

Setup

  1. Open Integrations and select LINE.
  2. Click Add Integration Config.
  3. Give the config a display name (e.g., "LINE — Support").
  4. Choose Channel Access Token and paste the long-lived token.
  5. Paste the channel secret into Channel Secret.
  6. Save the config.

A LINE channel accepts exactly one webhook URL, so Fruxon assigns one webhook per LINE config. Once the config is saved, generate the webhook URL and click Set webhook automatically — Fruxon registers it with LINE through the Messaging API.

Then switch on Use webhook in the LINE Developers console (Messaging API → Webhook settings). There is no API for this switch: until it is on, LINE delivers nothing. Fruxon tells you when it finds it off, both after registering the URL and when you verify the webhook. Click Verify in the LINE console to check that Fruxon answers.

Channels

LINE exposes a single channel descriptor:

ChannelDescription
chatA LINE conversation — a 1:1 chat with a person who added the account, or a group or multi-person chat the account was invited to.

Addresses are LINE's own ids:

  • U followed by 32 hex characters for a user (e.g. U4af4980629d6c3b07e4a4b3f6d1b2c3a).
  • C… for a group.
  • R… for a multi-person chat (room).

Display names and @LINE IDs aren't accepted. A user id is scoped to the LINE provider that owns the channel, so the same person has a different id under another provider.

How conversations behave

  • Replies use the push API. LINE's free reply API needs a token that expires about a minute after the customer's message, which an agent turn can outlast. Push works whenever the reply is ready, but it counts against the account's monthly message quota — once per recipient, so a reply into a group of five counts five.
  • Text only. LINE shows messages as plain text. Fruxon flattens the agent's Markdown: emphasis markers are dropped, links become label (url), and lists keep bullets or numbers. Replies longer than 5,000 characters are split into several messages.
  • Groups. LINE delivers every group message to the account. With the When addressed response policy, the agent answers only when someone @-mentions the account (or uses its name).
  • Typing indicator. In 1:1 chats, LINE's loading animation shows while the agent works.
  • Media. Images, videos, audio and files customers send are downloaded and passed to the agent. Stickers are ignored; a shared location reaches the agent as text.
  • Unknown senders. A sender in a group is identified only once they've consented to share their LINE profile with the account; until then their messages have no sender.

When the monthly quota runs out, LINE refuses pushes until the next month or a plan upgrade. Fruxon records those replies as rejected rather than retrying them. Use Get Message Quota Consumption to watch the count.

Triggers

TriggerDescription
line.message.receivedFires when the LINE Official Account receives a message — in a 1:1 chat, or in a group or multi-person chat it was invited to. Requires the webhook to be registered with LINE and Use webhook switched on.

The trigger payload includes the standard inbound-message fields (payload.text, payload.from, payload.from_name, payload.conversation_name, payload.conversation_address, payload.session_id, payload.event_type) plus LINE-specific fields:

  • payload.message_attributes.chat_id — the chat the message arrived in: the group (C…), room (R…) or user (U…) id.
  • payload.message_attributes.user_id — the sender's user id. Absent in a group when the sender hasn't consented to share it.
  • payload.message_attributes.message_type — text, image, video, audio, file or location.

Using in Your Agent

  1. Open your agent in Agent Studio and select an Agent Step
  2. Under Attached Integration Configurations, click Attach configuration and choose your config
  3. Attach LINE tools from the tools panel
  4. Tools are referenced as line.send_message, line.get_profile, etc.

Available Tools

ToolDescriptionAction Type
send_messagePush a plain-text message to a user, group or room. Counts against the monthly message quota.Irreversible
get_profileGet a user's display name, picture, status message and language.Read-only
get_group_summaryGet a group's name and picture.Read-only
get_message_quotaGet the account's monthly message limit.Read-only
get_message_quota_consumptionGet how many messages the account has sent this month.Read-only
get_bot_infoGet the account's own user id, LINE ID and display name.Read-only

On this page