BOT API
BOT API lets you interact directly with individual users through either a LINE official account or a LINE@ account. With BOT API you can use APIs to automatically send customized responses to users when they add your account as a friend or send it a message. You can also send interactive messages from your BOT API server to users at any time.
How BOT API works
Using BOT API, you can send information between your company’s servers and a user’s LINE app via the LINE platform. Requests are sent using JSON-based APIs.
Architecture
Your BOT API server is linked to the LINE platform. When a user adds your account as a friend or sends a message, the LINE platform sends a request to your registered BOT API server URL. Your server then sends a response based on that request. This gives your users a better experience as they can feel like they are interacting with a friend.
Receiving messages/operations
Information is sent from the LINE platform to your BOT API server whenever a user interacts with your account. There are two types of interactions:
- User sends a message (message)
- User performs an action such as adding your account as a friend (operation)
Information is sent via HTTP to your registered URL. A JSON string is generated in the request body for operations. The JSON string varies depending on the type of operation.
All requests include a signature in the header. Your BOT API server uses the signature to verify that requests are sent from the LINE platform. If the request is not sent from the LINE platform, the request is not valid and an unexpected event is triggered.
Calling APIs
You can useĀ APIs provided by the LINE platform to send information from your BOT API server to users. What you can do with the APIs:
- Send messages to individual users or to all users who have added your account as a friend
- Get users’ nicknames
Your BOT API server can call APIs to send messages to users at any time. When API calls are made, a Channel access token or Channel ID, Channel secret and the MID for your Channel is set in the request header to verify that the call is from your BOT API server. You can get a Channel access token or Channel ID, Channel secret and MID of your Channel from the LINE Developers site.
APIs are accessed via HTTPS. The path and parameters are different for each API.
What you can do with BOT API
Send and receive messages using APIs
Send and receive messages from users who have added your account as a friend. APIs are used for all messages that are sent.
Send rich messages using APIs
Send rich content messages that contain an image and a link. Rich messages are ideal for coupons, special promotions, news announcements, and blog posts.
Send link messages
Send messages that include a thumbnail and a link. Use link messages to redirect users to your website.
Send mission stickers
Send mission stickers to users that have completed a mission that you want them to accomplish.
Use the Channel Web Application feature
Make browsing your website from the LINE app seamless for users.
BOT API accounts
The features that you can use on BOT API are defined by the account types as shown below.
Account type | Features |
---|---|
Business Connect |
|
BOT API Trial |
|