# Messaging API overview

Use the Messaging API to build bots to provide personalized experiences on LINE to your users. To use the Messaging API, the first thing to do is to connect your bot with a channel on the LINE Platform. When you create a channel, the LINE Platform automatically creates a LINE Official Account for the channel.

What is LINE Official Account

If you are unfamiliar with LINE Official Account, visit the comprehensive learning platform, LINE Campus (opens new window) (only available in Japanese).

# How the Messaging API works

With the Messaging API, a bot server can send and receive data to and from the LINE Platform. Requests are sent over HTTPS in JSON. The communication flow between a bot server and the LINE Platform is as follows:

  1. A user sends a message to a LINE Official Account.
  2. The LINE Platform sends a webhook event to the webhook URL of the bot server.
  3. The bot server checks the webhook event and responds to the user through the LINE Platform.

# Try the demo

The LINE API Use Case (opens new window) site lets you try LINE Official Accounts and features that are implemented with the Messaging API. You can also see the code for the demo samples. Add different LINE Official Accounts from the site, as a friend on your smartphone and experience the Messaging API. For more information, see Chatbot (Messaging API) (opens new window).

# What you can do with the Messaging API

Here are the things you can do with the Messaging API.

# Send reply messages

With the Messaging API, you can send reply messages to users who added your LINE Official Account as a friend. For more information, see Sending messages.

# Send messages at any time

With the Messaging API, you can send messages directly to users at all times. For more information, see Sending messages.

# Send different message types

With the Messaging API, you can send different types of messages to users as listed below. For more information about the specification of these messages, see Message types.

# Get content sent by users

With the Messaging API, you can get images, videos, audio, and files sent by users. Content that users send is automatically deleted after a period of time. For more information, see Get content in the Messaging API reference.

# Get user profiles

With the Messaging API, you can get profile information of a user who interacts with your LINE Official Account, in one-on-one and group chats. The types of profile information you can get are user's display name, language, profile image and status message. For more information, see Get profile in the Messaging API reference.

# Join group chats

With the Messaging API, you can send messages in group chats and get information of the group chat members. For more information, see Group chats and multi-person chats.

# Use rich menus

With the Messaging API, you can set and customize a rich menu in a chat. Rich menus help users find how they can interact with your LINE Official Account. Users can use this menu from the chat at all times. For more information, see Use rich menus.

# Use beacons

With LINE Beacon, you can set your LINE Official Account to interact with the user who enters a beacon region. For more information, see Using beacons.

With the Messaging API, you can securely link user accounts in your service to their LINE accounts, if they friended your LINE Official Account. For more information, see User account linking.

# Get the number of sent messages

With the Messaging API, you can get the number of messages you sent from your LINE Official Account. The API returns only the number of messages sent through the Messaging API, not LINE Official Account Manager. For more information, see the following references:

# Messaging API pricing

You can get started with the Messaging API for free. Anyone can use the Messaging API to send a message from a LINE Official Account.

You can send a certain number of messages each month for free. The number of free messages depends on the subscription plan (opens new window) (only available in Japanese) of your LINE Official Account. The subscription plan may vary by country. See your country’s subscription plan for more information.

You can also send additional messages beyond the free message limit. You will be charged based on the number of additional messages sent. To send additional messages, open LINE Official Account Manager (opens new window), select your LINE Official Account, and then select a subscription plan that allows you to send additional messages. Here, set a maximum number of additional messages.

For more information about how to change your subscription plan and set a maximum number of additional messages, see the Activity and billing (subscription plan changes and payment related management) (opens new window) (only available in Japanese) page on LINE for Business.

How to count the number of messages sent

The number of messages is counted by the number of people you send a message to. Suppose you send a push message with four message objects in a single request to a chatroom with five people. Here, the number of messages sent is five. The number of message objects in a request doesn't affect the number of messages sent.

If you send a message to a user who blocked your LINE Official Account or a user ID that doesn't exist, the message isn't counted. If the user can't receive your message, that message doesn't count as sent.

# Next steps

As the next step, get started with the Messaging API to create a bot. The first thing you need to create is a Messaging API channel from the LINE Developers Console. When you create a channel, the LINE Platform creates a LINE Official Account for the channel.