API reference Development guidelines Quickstart Guides - Send messages
- Character counting in a text
- Get user IDs
- Stickers
- LINE emoji
- Use audiences
- Use quick replies
- Get statistics of sent messages
- Use LINE features with the LINE URL scheme
- Use beacons with LINE
- Gain friends of your LINE Official Account
- User account linking
- Customize icon and display name
- Display a loading animation
- Use membership features
- Get quote tokens
- Retrying a failed API request
- Stop using your LINE Official Account
- Stop using the Messaging API
- Tutorial - Make a reply bot
Webhooks Rich menus LINE Bot Designer Flex Message Concepts Reference Resources
API reference Development guidelines Quickstart Guides - Send messages
- Character counting in a text
- Get user IDs
- Stickers
- LINE emoji
- Use audiences
- Use quick replies
- Get statistics of sent messages
- Use LINE features with the LINE URL scheme
- Use beacons with LINE
- Gain friends of your LINE Official Account
- User account linking
- Customize icon and display name
- Display a loading animation
- Use membership features
- Get quote tokens
- Retrying a failed API request
- Stop using your LINE Official Account
- Stop using the Messaging API
- Tutorial - Make a reply bot
Webhooks Rich menus LINE Bot Designer Flex Message Concepts Reference Resources
# Get quote tokens
When you want to send a message quoting a past message with the Messaging API, you use quote tokens. This page explains how to get quote tokens.
# What is a quote token
A quote token is a string like IStG5h1Tz7bsH6xinEQtKQ9IdtcN5wLE15-LwtIDCEYAqDkV741O-XkOhZo1GYxw2UCURKnpHujpZuZaBaeQZVOVpKiaEeAz1Ye3-3ZYbPQVjuXZ4x8ZpISG7WhJDCE8o-hhHh8uMBRyp3b0L_Cxlg
. Quote tokens are required to send quote messages.
Quote tokens can only be used in one-on-one chats, group chats, and multi-person chats where the message to be quoted was sent. Quote tokens have no expiration date and the same quote token can be used multiple times.
# Get quote tokens
There are two ways to get quote tokens:
# Get quote tokens via webhook
When a user sends a message in a one-on-one chat, group chat, or multi-person chat where your LINE Official Account is added, a message event of webhook is sent to your bot server. In this message event, the following message objects include the quote tokens (quoteToken
):
"message": {
"type": "text",
"id": "468789577898262530",
"quoteToken": "q3Plxr4AgKd...", // Quote token
"text": "Can I reserve a table for dinner tonight?"
}
For more information about webhook, see Receive messages (webhook).
# Get quote tokens in the response when sending a message
When you send a reply message or a push message with the Messaging API, a JSON object containing the sentMessages
property is returned as a response.
{
"sentMessages": [
{
"id": "461230966842064897",
"quoteToken": "IStG5h1Tz7b..."
}
]
}
However, quote tokens (sentMessages[].quoteToken
) are included in the response only when the following message objects that can be specified as quote targets are sent:
- Text message
- Text message (v2)
- Sticker message
- Image message
- Video message
- Template message (only
altText
is displayed when quoted) - Flex Message (only
altText
is displayed when quoted)
If you send a message specifying multiple of the above message objects, you will receive the same number of quote tokens. In this case, the order of the elements in the sentMessages
array is guaranteed to be the same as the order of the message objects when they were sent.
{
"sentMessages": [
{
"id": "471875397094211585",
"quoteToken": "YKPDqjc2jmW..."
},
{
"id": "471875397127766017",
"quoteToken": "eG5SfLhgiFX..."
}
]
}