Integrations

LINE

Connect a chatbot to LINE so people can ask it questions inside the LINE app. You create a Messaging API channel in the LINE Developers console, paste two values into Aimy, then paste one URL back into LINE. Pro plan only.

LINE is currently marked Coming soon. Unlock it first — see Testing the new integrations.

Before You Start

  • A LINE account, and a free LINE Developers account.
  • A chatbot in Aimy with at least one document uploaded.
  • No business verification or approval is needed for standard messaging — this is the easiest of the new channels to test.

Step 1 — Create a Messaging API channel

1. Create a provider. In the LINE Developers console, click Create a new provider and give it any name (your company works). A provider is just a container.

2. Create the channel. Inside the provider, click Create a Messaging API channel. Fill in the channel name and description — the channel name is what users see as the bot's display name.

3. Open the Messaging API tab. Scroll to Channel access token (long-lived) and click Issue. Copy the long string it produces.

4. Open the Basic settings tab. Find Channel secret and copy it. This is a different, shorter value — do not confuse the two.

You now have two values: a long channel access token (used to send messages) and a shorter channel secret (used to verify that incoming messages really came from LINE).

Step 2 — Connect in Aimy

5. Open the integration. Go to Integrations, click the LINE card, then pick the chatbot you want to answer from using the tabs.

6. Paste both values. Put the long token into Channel access token and the shorter one into Channel secret, then click Connect.

Verify: Aimy calls LINE to check the token before storing anything. On success the status pill shows your bot's display name. If you see "That channel access token was rejected by LINE", you have pasted the wrong value or an expired token.

Step 3 — Give LINE the webhook URL

7. Copy the URL. After connecting, a Webhook URL box appears. Click Copy. It looks like:

https://aimy.com.my/chat/apps/chatbot_service/public/api/integrations/line_webhook.php?integration_id=12

8. Paste it into LINE. Back in the console, on the Messaging API tab, paste it into Webhook URL and click Update.

9. Turn the webhook on. Toggle Use webhook to enabled. This is easy to miss and nothing arrives without it.

Verify: click Verify next to the webhook URL. LINE sends an empty event and expects a 200 — you should see Success. If not, check the error log for line_webhook.

Step 4 — Turn off LINE's own auto-replies

10. Disable the greeting and auto-reply. Still on the Messaging API tab, find Auto-reply messages and Greeting messages and disable both.

If you skip this, LINE answers with its own canned message as well as your chatbot's answer, and you will get two replies to every question.

Step 5 — Test it

11. Add the bot. On the Messaging API tab there is a QR code. Scan it in the LINE app to add the bot as a friend.

12. Ask a real question. Send it something your uploaded documents can answer — not "hello". A greeting proves nothing about retrieval.

Verify: the answer should arrive within a few seconds. Then check Chat History in the admin panel — the conversation should be there, and usage should appear under LINE on the usage breakdown.

How it works

Each LINE user gets their own conversation, keyed by a hash of their LINE user ID. Answers are sent using LINE's reply token when possible, which is free and does not count against your monthly message quota. If an answer takes longer than LINE's reply window allows — which happens on large spreadsheet questions — Aimy falls back to a push message, which does count against the quota.

Long answers are split into up to five messages of about 4,900 characters each.

Troubleshooting

  • Verify button fails. The webhook URL is wrong or was not saved. Re-copy it from Aimy — the integration_id changes if you disconnect and reconnect.
  • Two replies to every message. LINE's auto-reply is still on. See Step 4.
  • No reply at all, Verify passes. Check the log for line_webhook. "bad signature" means the channel secret is wrong.
  • Replies stop after a while. You may have exhausted the free push-message quota. Check the console's usage page.
Each chatbot can hold one LINE channel at a time. To move it, disconnect first, then connect the same credentials under a different chatbot.