Your bot can interact with users using various types of messages provided by the LINE Platform. Use the following types of messages to create interactive experiences for your users.
For more detailed information about messages, see message objects.
Reply and push messages
Messages sent with the Messaging API can be divided into two categories: reply messages and push messages.
Reply messages are messages that you can send only after a user-generated event such as when the user sends your bot a message or adds your bot as a friend. To send reply messages, you must have a reply token which is included in a webhook event object. For more information, see send reply message.
Push messages are messages that you can send to users at any time. Use the
/message/push endpoint to send messages to a single user and the
/message/multicast endpoint to send messages to multiple users.
Note: Push messages are limited to certain plans. For more information about plans, see LINE@ plans.
To send a text message include the text in a message object.
You can include LINE original emoji in text messages using character codes. For a list of LINE emoji that can be sent in LINE chats, see the emoji list.
For more information, see text message object.
You can use stickers to make your bot more expressive and engaging for your users. To send a sticker, include the package ID and sticker ID of the sticker in a message object. For a list of stickers that can be sent with the Messaging API, see the sticker list.
For more information, see sticker message object.
To send images, include URLs of the original image and a smaller preview image in the message object. The preview image is displayed in the chat and the full image is opened when the image is tapped. Note that the URLs must use HTTPS.
For more information, see image message object.
To send a video, include the URL of the video file and the URL of a preview image in the message object. The user can play the video by tapping on the preview image. Note that the URLs must use HTTPS.
For more information, see video message object.
To send an audio file, include the URL of the file and the duration in the message object. Note that the URL must use HTTPS.
For more information, see audio message object.
To send your location information to users, include a title, address, and latitude and longitude coordinates in the message object.
For more information, see location message object.
Imagemap messages consist of an image with specified tappable areas that correspond to different links or actions.
To send an imagemap, provide the image in multiple resolutions to support different devices. You must specify the base URL and the base size of the image. You can then define tappable areas on the image which redirects the user to a link or sends a specified text message from your user to your bot.
For more information, see imagemap object.
Template messages have predefined layouts that help you create richer experiences for your users. Use template actions to make it easier for users to interact with your bot by letting them perform certain actions with a single tap instead of manually typing a text message.
For more detailed information about template messages, see the template messages reference.
Template message types
Here are the types of template messages available.
Use the buttons template to send a message with an image, title, text and multiple action buttons.
For more information, see buttons template.
Use the confirm template to send a message with two buttons.
For more information, see confirm template.
Use the carousel template to send a message with multiple column objects that users can cycle through.
For more information, see carousel template.
Image carousel template
Use the image carousel template to send a message with multiple images that users can cycle through.
For more information, see image carousel template.
You can set different types of actions for your bot to take when a user taps a button or an image in a template message. The following template actions can be used in template messages.
Use the postback action to return a specified string in a postback event to your server. You can also include text which is sent as a message from the user.
For more information, see the postback action reference.
Use the message action to send a specified string as a text message from the user.
For more information, see the message action reference.
Use the URI action to redirect the user to a specified URI.
For more information, see the URI action reference.
Datetime picker action
Use the datetime picker action to let the user choose a specific date, time, or date and time from a menu. The date and time selected by the user is returned in a postback event via a webhook.
For more information, see the datetime picker action reference.
To see detailed information about how to send messages, see message objects.