For the complete documentation index, see llms.txt. This page is also available as Markdown.

Connect a Conversation Platform: LINE WORKS

Connect the LINE WORKS messaging platform:create a Client App and Bot in Developer Console, obtain a Service Account and Bot Secret, configure the Callback URL, and activate the Bot.

LINE WORKS is LINE's enterprise communication tool. Once connected, employees can chat with an Agent directly in LINE WORKS without opening another system. Both one-on-one direct messages and group conversations are supported.

LINE WORKS and LINE are separate platforms with entirely different credentials and setup procedures. To connect a consumer-facing LINE Official Account, see Connect a Messaging Platform:LINE.

Before You Connect


Step 1:Create a Client App and Obtain a Service Account

1. Open the ClientApp Page in Developer Console

Log in to the LINE WORKS Developer Console, select API → ClientApp in the left menu, then click Add client app to create an App.

ClientApp list page in Developer Console
Developer Console → API → ClientApp

2. Obtain the Four Credentials

Open the App's details page and obtain the following four items:

Credential
Location in Console

Client ID

Client ID field

Client Secret

Client Secret field

Service Account

Service Account field, in the format xxxxx.serviceaccount@your-domain

Private Key

Private Key section; a .key file is available for download when created

Client App details page with Client ID, Client Secret, OAuth Scopes, Service Account, and Private Key
Client App details page — all four credentials and OAuth Scopes are on this page

3. Configure OAuth Scopes

Grant the following permissions in the OAuth Scopes section on the same page. Without them, the Agent cannot send or receive messages or look up member names:

Scope
Description

bot

Manage the Bot

bot.message

Send messages

bot.read

Read Bot settings

user.read

Read member information (used to display the speaker's name in conversations)

Token Settings on the same page lets you adjust the Access Token's validity period. MaiAgent automatically manages token issuance and renewal, so you can keep the default value here.

The private key must be in unencrypted PEM format: the first line contains the BEGIN PRIVATE KEY or BEGIN RSA PRIVATE KEY marker (with five hyphens on each side), and the last line contains the corresponding END marker. MaiAgent cannot use a password-protected private key. Generate an unencrypted one instead.


Step 2:Create a Bot and Obtain the Bot ID and Bot Secret

Select Bot in the left menu of Developer Console, create a Bot, and obtain:

Credential
Location in Console

Bot ID

Bot ID field

Bot Secret

Bot Secret field, used to verify that messages sent by LINE WORKS actually come from your Bot

Bot details page with the Bot name, Bot ID, Bot Secret, Callback URL, and Bot Policy
Bot details page — find the Bot ID and Bot Secret here

Required Settings for Group Conversations

On the Bot's Edit page, find Bot Policy → Join Chat Rooms and select Can be invited to team/group and 1:N chat rooms.

Without this option, the Bot can only exchange one-on-one direct messages and cannot be invited to a group.

The Bot name is also configured on this page. Users enter this name when they @ mention the Bot in a group, so choose a name that is easy to type.

Skip the Callback URL for now. It requires a Webhook URL generated by MaiAgent. You will return to fill it in during Step 4.


Step 3:Create a LINE WORKS Messaging Platform in MaiAgent

1. Open Connect Messaging Platform

Select Messaging Platforms in MaiAgent's left menu, click Connect Messaging Platform in the upper right, and select LINE WORKS.

2. Fill In the Basic Settings

Field
Description

Name

Name this integration (required). This is only a label in MaiAgent and is unrelated to the Bot name displayed in LINE WORKS.

AI Assistant

Select the Agent to link

Bot ID

Obtained in Step 2 (required)

Bot Secret

Obtained in Step 2 (required)

Client ID

Obtained in Step 1 (required)

Client Secret

Obtained in Step 1 (required)

Service Account

Obtained in Step 1 (required)

Private Key

Paste the entire contents of the .key file downloaded in Step 1, including the opening and closing marker lines (required)

The form has an upper and a lower section. The upper section contains the name, Agent, and the Bot ID and Bot Secret obtained in Step 2:

Upper section of the MaiAgent LINE WORKS creation form with Name, Agent, Bot ID, and Bot Secret
Upper section of the creation form — Name, Agent, Bot ID, Bot Secret (example values shown)

Scroll down to find the three Client App credentials and private key obtained in Step 1:

Lower section of the MaiAgent LINE WORKS creation form with Client ID, Client Secret, Service Account, and Private Key
Lower section of the creation form — Client ID, Client Secret, Service Account, Private Key (example values shown)

Bot Secret and Client Secret are masked with dots after entry. Click the eye icon on the right of a field to check its contents. Paste the entire contents of the .key file directly into Private Key; line breaks are preserved.

3. Chat Room Settings

Setting
Description

Require @Bot to Reply in Groups

When enabled, the Bot only replies in group conversations when @ mentioned. Recommended for group use; otherwise, every message in the group triggers an Agent reply.

Enable Reset Command

When enabled, you can add one or more command texts (for example, "Start over"). When a user's message in LINE WORKS exactly matches one of them, a new conversation starts for that user. The command itself receives no reply. The AI responds in the new conversation when the user sends their next message.

"Require @Bot to Reply in Groups" matches the Bot name configured in Developer Console, rather than the Inbox name entered in the "Name" field above. If you change the Bot name in Developer Console, the name to @ mention in groups changes too.

4. Test the Integration

Click Test Integration. MaiAgent requests an access token from LINE WORKS to verify that the credentials work together.

If the test fails, the screen displays the specific reason. Two common errors are:

  • Credential validation failed — Check, in order, that the entire Private Key was pasted (including the opening and closing marker lines and all line breaks in between), that it is unencrypted, that the Service Account is complete (including the .serviceaccount@domain suffix), that Client ID and Client Secret belong to the same App, and that the App has the four Scopes listed in Step 1

  • This Bot ID is already linked to another inbox — The same Bot cannot be connected to two messaging platforms at once. Use another Bot, or delete the existing messaging platform first

The error message appears to the left of the button:

When the integration test fails, the error message appears to the left of the Test Integration button
Location of the integration test error message (this example shows a Bot ID already linked to another inbox)

5. Create the Channel and Copy the Webhook URL

Click Connect Messaging Platform to finish creating the channel. The system generates a Webhook URL. Copy it for the next step, where you will enter it in Developer Console.

You can also return to the channel's settings page at any time and copy this URL from the API Integration field.

Settings page for the LINE WORKS channel, with read-only Bot ID, Client ID, and Service Account, and a Webhook URL for API Integration
Settings page after creation — credentials are no longer displayed, and the Webhook URL can be copied at any time

Step 4:Return to Developer Console to Configure the Callback URL

Return to the Bot created in Step 2 and open the Edit page:

  1. Set Callback URL to On and enter the Webhook URL generated by MaiAgent

  2. Under Callback Event Settings, select the events to receive. Select all options under Message Event so the Agent can handle all message types:

Event
Corresponding User Action

TEXT

Send a text message

Photo

Send an image

File

Send a file

Audio

Send a voice message

Video

Send a video

Location Sharing

Share a location

Sticker

Send a sticker

  1. If you plan to use the Bot in groups, also select Join Event and Joined Event

  2. Save the settings

Callback URL and Callback Event Settings on the Bot edit page
Set Callback URL to On, enter the Webhook URL, and select the event types below

Step 5:Activate the Bot in the Admin Console

Log in to the LINE WORKS Admin console, open Services → Bot in the left menu, and click Add Bot in the upper right to add the Bot created in Step 2.

Once added, the Bot appears on this page. Use the Access Permissions field to specify which members can see it (selecting All makes it available to all members).

Services → Bot page in the LINE WORKS Admin console, listing added Bots and their access permissions
Admin console → Services → Bot — add a Bot and configure access permissions

Getting Started

One-on-One Direct Messages

Search for the Bot's name in LINE WORKS and start a conversation. The Agent replies automatically.

One-on-one conversation with an Agent in a LINE WORKS chat room
Chat directly with an Agent in a LINE WORKS chat room

LINE WORKS chat rooms display plain text only and do not render Markdown. If the Agent outputs a table or syntax such as **bold** or ###, users see the raw symbols. Add formatting rules to the Agent's role instructions asking it to use numbered lists and line breaks instead of Markdown syntax.

Group Conversations

Invite the Bot to a group. If "Require @Bot to Reply in Groups" is enabled, enter @BotName your question to trigger a reply.

In MaiAgent's All Conversations, each group appears as a single conversation, with the speaker's name displayed on each message. Messages from multiple group members do not create separate parallel conversations.

Supported Message Types

What the User Sends
How the Agent Handles It

Text

Answers directly

Image

Can recognize the image's contents

File (PDF, Excel, Word, etc.)

Reads the contents and answers related questions

Voice message

Converts to text for processing

Video

Saves it as an attachment in the conversation

Location

Displays "📍 Location shared"

Sticker

Displays "🏷 Sticker"

The Agent supports text and attachments in replies. If a single text message exceeds LINE WORKS' 1,000-character limit, the system automatically splits it into multiple messages without truncating it.


FAQ

The Agent Suddenly Stopped Replying

First, open the channel's settings page and check for a Credentials are invalid warning.

The most common cause of invalid credentials is regenerating the private key or Service Account in Developer Console. Once the old credentials are replaced, MaiAgent can no longer obtain an access token.

Because credentials cannot be edited in place, create a new LINE WORKS channel and enter the new credentials.

The only visible symptom of invalid credentials is that the Agent goes silent; users receive no error message. If a colleague reports that "the bot isn't responding," this is the first place to check.

Why Can't Credentials Be Changed?

Credentials are sensitive data. Once stored, MaiAgent does not return them to the frontend or allow changes on the settings page, to avoid repeatedly exposing them during transmission and on screen. Bot ID, Client ID, and Service Account are displayed as read-only values so you can verify which Bot is connected.

To replace any credential, delete this channel and create it again.

The Bot Does Not Respond to @ Mentions in a Group

  • Check that the @ mention matches the Bot name in Developer Console, rather than the Inbox name in MaiAgent

  • On the Bot edit page, check that Can be invited to team/group and 1:N chat rooms is selected under Bot Policy → Join Chat Rooms

  • Check that TEXT is selected under Callback Event Settings

Do Tokens Need to Be Renewed Manually on a Regular Basis?

No. MaiAgent authenticates using a Service Account. The system automatically issues and renews access tokens, so they do not become invalid over time. The integration remains valid as long as the credentials in Developer Console are not regenerated.

Last updated

Was this helpful?