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.
Before You Connect
You have created an "AI Assistant" on the MaiAgent platform
You have LINE WORKS administrator permissions (you can log in to the Admin console)
You can access the LINE WORKS Developer Console
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.

2. Obtain the Four Credentials
Open the App's details page and obtain the following four items:
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

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:
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)
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:
Bot ID
Bot ID field
Bot Secret
Bot Secret field, used to verify that messages sent by LINE WORKS actually come from your Bot

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.
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
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:

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

3. Chat Room Settings
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.
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@domainsuffix), that Client ID and Client Secret belong to the same App, and that the App has the four Scopes listed in Step 1This 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:

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.

Step 4:Return to Developer Console to Configure the Callback URL
Return to the Bot created in Step 2 and open the Edit page:
Set Callback URL to On and enter the Webhook URL generated by MaiAgent
Under Callback Event Settings, select the events to receive. Select all options under Message Event so the Agent can handle all message types:
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
If you plan to use the Bot in groups, also select Join Event and Joined Event
Save the settings

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).

Getting Started
One-on-One Direct Messages
Search for the Bot's name in LINE WORKS and start a conversation. The Agent replies automatically.

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
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.
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?