Integrate with Platform: LINE WORKS
LINE WORKS is the enterprise version of LINE's communication tool. Once integrated, employees can chat directly with the AI assistant within LINE WORKS without opening another system. Both one-on-one direct messages and group conversations are supported.
Pre-Integration Checklist
An "AI Assistant" has already been created on the MaiAgent platform
You have LINE WORKS administrator privileges (can log in to the Admin console)
You can access the LINE WORKS Developer Console
This integration requires 6 sets of credentials, and credentials cannot be modified after the channel is created. Complete Step 1 and Step 2 first to gather all 6 credentials before proceeding to Step 3.
Step 1: Create a Client App and Obtain the Service Account
1. Go to the ClientApp Page in Developer Console
Log in to the LINE WORKS Developer Console, click API → ClientApp in the left menu, then click Add client app to create an App.
2. Obtain Four Sets of Credentials
Go to the App's detail 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@yourdomain
Private Key
Private Key section, downloadable as a .key file during creation
3. Configure OAuth Scopes
In the OAuth Scopes section on the same page, grant the following permissions. Without these, the AI assistant cannot send or receive messages or look up member names:
bot
Manage Bot
bot.message
Send messages
bot.read
Read Bot settings
user.read
Read member information (used to display the sender's name in conversations)
The Private Key can only be downloaded once. A .key file is provided for download when creating the Service Account. Once you leave the page, it cannot be retrieved again. Save it securely — if lost, you can only regenerate a new one, which will immediately invalidate the existing integration.
The private key must be in unencrypted PEM format: the first line is a BEGIN PRIVATE KEY or BEGIN RSA PRIVATE KEY marker (with five hyphens before and after), and the last line is the corresponding END marker. If your private key is password-protected, MaiAgent cannot use it — regenerate an unencrypted one.
Step 2: Create a Bot and Obtain the Bot ID and Bot Secret
Click Bot in the left menu of the Developer Console, create a Bot, and obtain:
Bot ID
Bot ID field
Bot Secret
Bot Secret field, used to verify that messages from LINE WORKS actually originate from your Bot
Required Settings for Group Conversations
On the Bot's Edit page, find Bot Policy → Join Chat Room, and check Allow to be invited to teams/groups and 1:N chat rooms.
Without this checked, the Bot can only handle one-on-one direct messages and cannot be invited to groups.
The Bot Policy summary text on the Bot detail page has been observed to be inconsistent with the actual checkbox state in the edit form. If the two differ, rely on the checkbox state in the Edit form.
Bot Name is also set on this page. This name is what users type when @mentioning the Bot in a group, so choose a name that is easy to type.
Step 3: Create a LINE WORKS Channel in MaiAgent
1. Go to Channel Integration
In the MaiAgent left menu, click Channels, click Integrate Channel in the upper right corner, and select LINE WORKS.
2. Fill in Basic Settings
Name
Give this integration a name (required). This is only a label on the MaiAgent side and is unrelated to the Bot name displayed in LINE WORKS.
AI Assistant
Select the AI assistant to bind
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 full content of the .key file downloaded in Step 1, including the begin and end marker lines (required)
The form is divided into two sections. The upper section contains the name, AI assistant, and the Bot ID and Bot Secret from Step 2:
Scroll down for the three Client App credentials and private key from Step 1:
3. Chat Room Settings
Require @Bot to reply in groups
When enabled, the Bot only replies in group conversations when @mentioned. Recommended when using in groups — otherwise, every message in the group triggers an AI assistant response.
Enable reset command
When enabled, you can customize a keyword that allows users to clear conversation memory and start over.
4. Integration Test
Click Integration Test. MaiAgent will actually request an access token from LINE WORKS to verify the credential combination is correct.
On failure, the screen displays the specific reason. The two most common ones:
Credential verification failed — Check in order: whether the Private Key was fully pasted (including the begin and end marker lines, with no missing line breaks), whether it is in unencrypted format, whether the Service Account is complete (including the
.serviceaccount@domainsuffix), whether Client ID and Client Secret are from the same App, and whether the App has been granted the four Scopes listed in Step 1This Bot ID is already bound to another inbox — The same Bot cannot be connected to two channels simultaneously. Use a different Bot, or delete the existing channel first
The failure message appears to the left of the button:
5. Create and Copy the Webhook URL
Click Integrate Channel to complete the creation. The system generates a Webhook URL — copy it for the next step, where you will paste it back into the 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
Go back 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, check the events to receive. It is recommended to check all options under Message Event so the AI assistant can handle all types of messages:
TEXT
Send a text message
Photo
Send an image
File
Send a file
Audio
Send a voice message
Video
Send a video
Location
Share a location
Sticker
Send a sticker
If using in groups, it is also recommended to check Join Event and Joined Event
Save the settings
Unchecked event types will not be sent to MaiAgent by LINE WORKS. Those messages will be as if they never happened — the AI assistant will not reply, and no record will appear in the conversation.
Step 5: Activate the Bot in the Admin Console
Log in to the LINE WORKS Admin console, go to Service → Bot in the left menu, and click Add Bot in the upper right corner to add the Bot created in Step 2.
After adding, this page lists the Bot and allows you to configure which members can see it in the Usage Permissions column (set to All for all members).
This step is easy to miss. After creating the Bot in Developer Console, it does not yet appear in employees' LINE WORKS. A tenant administrator must add it in the Admin console before employees can find it.
Getting Started
Direct Message
Search for the Bot name in LINE WORKS and start a conversation. The AI assistant replies automatically.
Group Conversation
Invite the Bot to a group. If "Require @Bot to reply in groups" is enabled, type @BotName your question to trigger a reply.
In MaiAgent's All Conversations, the same group appears as a single conversation with the sender's name displayed on each message. Multiple people speaking in the group will not be split into separate parallel conversations.
Supported Message Types
Text
Replies directly
Image
Can recognize image content
File (PDF, Excel, Word, etc.)
Reads the content and answers related questions
Voice message
Converts to text before processing
Video
Saved as an attachment and recorded in the conversation
Location
Displayed as "📍 Location shared"
Sticker
Displayed as "🏷 Sticker"
The AI assistant supports text and attachments in replies. If a single text message exceeds LINE WORKS' 1,000-character limit, the system automatically splits it into segments — nothing is truncated.
FAQ
The AI Assistant Suddenly Stopped Replying
First, go to the channel's settings page and check whether a credentials expired warning is displayed.
The most common cause of credential expiration 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.
Since credentials cannot be modified in place, create a new LINE WORKS channel and enter the new credentials.
Why Can't Credentials Be Modified?
Credentials are sensitive data. After MaiAgent stores them, they are never sent back to the frontend, and the settings page does not accept modifications to avoid repeated exposure of credentials during transmission and on screen. Bot ID, Client ID, and Service Account are displayed in read-only mode so you can verify which Bot is currently connected.
To replace any credential, delete this channel and create a new one.
@Mentioned the Bot in a Group but Got No Response
Verify that the @ name matches the Bot name in Developer Console, not the Inbox name in MaiAgent
Verify that on the Bot edit page, Bot Policy → Join Chat Room has Allow to be invited to teams/groups and 1:N chat rooms checked
Verify that Callback Event Settings has TEXT checked
Do I Need to Periodically Renew the Token?
No. MaiAgent uses Service Account authentication, where access tokens are automatically issued and renewed by the system. They do not expire over time. As long as the credentials in Developer Console have not been regenerated, the integration remains active.
Last updated
Was this helpful?
