# Option API reference for corporate customers

Use of optional functions requires an application

Only corporate users who have submitted the required applications can use the functions described in this document. To use these functions with your LINE Official Account, contact your sales representative or contact our Sales partners (opens new window).

# Common specifications

# Status codes

For more information, see Status codes in the Messaging API reference.

# Response headers

The following HTTP headers are included in Options for corporate customers API responses:

Response header Description
x-line-request-id Request ID. An ID is issued for each request.

# Mission stickers API

Mission stickers are provided to users upon completion of certain objectives. Using stickers as an incentive, users are encouraged to "link ID information," "register as a member," or "answer a questionnaire."

# Send mission stickers (v3)

Sends a mission sticker.

Tip

Unlike "Send mission stickers (v2)", it isn't necessary to register the IP or network address of the server that connects this endpoint in the LINE Developers Console.

Example request

# HTTP request

POST https://api.line.me/shop/v3/mission

# Request headers

Content-Type

Required

application/json

Authorization

Required

Bearer {channel access token}

# Request body

to

String

Required

Destination user ID

productType

String

Required

STICKER

productId

String

Required

Package ID for a set of stickers

sendPresentMessage

Boolean

Required

false

# Response

Returns status code 200 and an empty response body.

# Error response

This JSON data is returned in the response body when an error occurs.

message

String

Message containing error information. For more information, see Error messages.

# Error messages

These are the main error messages that are found in the message property of the JSON error responses.

Message Description
invalid request The destination user ID specified for to is invalid.
not found The package ID specified for productId is invalid.
internal error The package ID specified for productId is invalid.
not allowed to use the API The channel is not granted the required permission for the mission sticker API.
not_sales_period The date and time when the sticker set was sent is not within the valid period of the sticker set.
not sale for country The sticker set specified for productId isn't available for purchase in the country of the destination user specified for to.
not sale for device The device of the destination user specified for to doesn't support the sticker set specified for productId.
not sale for version The LINE app used by the destination user specified for to doesn't support the sticker set specified for productId.

# Send mission stickers (v2)

Sends a push mission sticker to a user at any time.

Note

It's necessary to register the IP or network address of the server that connects this endpoint in the LINE Developers Console. Add the server IP address or network address to the Security Management tab of the target channel.

Example request

# HTTP request

POST https://api.line.me/v2/missionSticker/send

# Request headers

Content-Type

Required

application/json

X-Line-ChannelId

Required

Channel ID. You can check this property in the LINE Developers Console.

X-Line-ChannelSecret

Required

Channel secret. You can check this property in the LINE Developers Console.

X-Line-Trusted-User-With-ACL

Required

Value assigned when the permission to use the Mission Stickers API is granted. For more information, contact your LINE representative.

# Request body

to

String

Required

Destination user ID

messages

Array

Required

An array that has an object that includes the packageId and isPresent properties. Only one object can be specified.

messages[].packageId

String

Required

Package ID for a set of stickers

messages[].isPresent

Boolean

Required

false

# Response

Returns status code 200 and a JSON object with these properties.

ticketId

String

Value used inside LINE.
Returns ticketId if the API call is successful.

Example response

# Error response

This JSON data is returned in the response body when an error occurs.

message

String

Message containing error information. For more information, see Error messages.

# Error messages

These are the main error messages that are found in the message property of the JSON error responses.

Message Description
authentication failed This message is returned in either or both cases below:
  • Any of the X-Line-ChannelId, X-Line-ChannelSecret, or X-Line-Trusted-User-With-ACL headers are incorrect.
  • The server that connects this endpoint isn't registered on the "Security settings" tab in the LINE Developers Console.
CHANNEL_MISSION_STICKER_NOT_USABLE The channel isn't granted the required permission for the mission sticker feature.

# Audience Match API

# Rate limits

The rate limits on API requests for the Audience Match API are the same as the Rate limits for the Messaging API.

# Message types

You can use all Messaging API message types.

Unavailable actions

You can't set actions other than URI actions for these message types:

Messages won't be sent if an action other than the URI action is set. Also, other messages in the same request aren't sent.

# Unsupported features

These properties and request headers aren't available for the Audience Match API:

# Send a message using phone number

Serves targeting delivery based on the user's phone number.

Only for users who have agreed to the LINE Privacy Policy (revised March 2022)

The messages will only be sent to users who have agreed to the privacy policy (revised March 2022) (opens new window), the users who haven't agreed to the privacy policy won't receive the message.

Therefore, the number of messages sent may be less than the number of destinations specified.

Example request

# HTTP request

POST https://api.line.me/bot/ad/multicast/phone

# Request headers

Content-Type

Required

application/json

Authorization

Required

Bearer {channel access token}

# Request body

to

Array of hashed phone number

Required

Destination of the message (A value obtained by hashing the telephone number, which is another value normalized to E.164 format, with SHA256).
Max message limit: 150

messages

array of message objects

Required

Message to send.
Max message limit: 5

notificationDisabled

Boolean

Optional
  • true: The user doesn’t receive a push notification when a message is sent.
  • false: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device).

The default value is false.

# Response

Returns status code 200 and an empty JSON object.

Example response

# Get result of message delivery using phone number

Gets the delivery result of the message delivered in Send message using phone number.

Example request

# HTTP request

GET https://api.line.me/v2/bot/message/delivery/ad_phone?date={date}

# Request headers

Content-Type

Required

application/json

Authorization

Required

Bearer {channel access token}

# Query parameters

date

Required

Date the message was sent

  • Format: yyyyMMdd (e.g. 20190831)
  • Time Zone: UTC+9

# Response

Returns status code 200 and a JSON object with these properties:

status

String

Aggregation process status. One of:

  • ready: The number of messages can be obtained.
  • unready: We haven't finished calculating the number of sent messages for the specified in date. For example, this property is returned when the delivery date or a future date is specified. Calculation usually takes about a day.
  • unavailable_for_privacy: The total number of messages on the specified day is less than 20.
  • out_of_service: The specified date is earlier than the date on which we first started calculating sent messages (March 31, 2018).

success

Long

The number of messages delivered using the phone number on the date specified in date. The response has this property only when the value of status is ready.

# Mark-as-Read

# Mark messages from users as read

All messages sent from a specific user can display "Read" at any time.

Example request

# HTTP request

POST https://api.line.me/v2/bot/message/markAsRead

# Request headers

Content-Type

Required

application/json

Authorization

Required

Bearer {channel access token}

# Request body

chat.userId

String

Required

The target user ID

# Response

Returns status code 200 and an empty JSON object.

Example response

# LINE notification messages API

# Rate limits

The LINE Notification Message API complies with the Rate limits of the Messaging API.

# Send LINE notification message

An API that sends a LINE notification message by specifying the user's phone number.

Restrictions on request source IP addresses

When sending LINE notification messages, don't register the IP address of the server that can call the API of the LINE Platform in the [Security Settings] tab of the Messaging API channel. Sending a LINE notification message with the requestor's IP address restricted may result in sending failure. For more information on how to set it up, see Configure security settings (optional).

You can only send messages to users who have agreed to LINE's privacy policy (revised in March 2022)

Messages will only be sent to users who have agreed to the Privacy Policy (revised March 2022) (opens new window) and won't be sent to users who haven't agreed.

Example request

# HTTP request

POST https://api.line.me/bot/pnp/push

# Request header

Unsupported features

The LINE notification messages API doesn't allow API request retries using retry keys (X-Line-Retry-Key).

Content-Type

Required

application/json

Authorization

Required

Bearer {channel access token}

X-Line-Delivery-Tag

Optional

String returned in the delivery.data property of the delivery completion event via Webhook. For more information, see Get message delivery notifications.
Minimum character count: 16
Max character count: 100

Example X-Line-Delivery-Tag

# Request body

to

Required

Message destination. Specify a phone number that has been normalized to E.164 format and hashed with SHA256.

Note

messages

Array of message objects

Required

Message to be sent. Max: 5

For more information, see Messages that can be sent via the LINE notification messages API.

# Response

Returns status code 200 and an empty JSON object.

Example response

# Error response

Returns a JSON object containing error information along with a 4xx HTTP status code. See Error responses in Common specifications.

The error that occurs with the 422 HTTP status code below is an error specific to the LINE Notification Message API.

message

String

Failed to send a LINE notification message using the LINE notification messages API. These are possible reasons:

Example error response

# Get number of sent LINE notification messages 

Gets the number of LINE notification messages sent using the /bot/pnp/push endpoint.

For more information, see Get the number of sent LINE notification messages in the LINE notification message documentation.

Example request

# HTTP request

GET https://api.line.me/v2/bot/message/delivery/pnp

# Request header

Authorization

Required

Bearer {channel access token}

# Query parameter

date

Required

Date the message was sent

  • Format: yyyyMMdd (Example:20211231)
  • Time zone: UTC+9

# Response

Returns status code 200 and a JSON object with this information.

status

String

Aggregation processing status. One of:

  • ready: You can get the number of messages.
  • unready: The total number of messages for the date specified in date isn't yet complete. Try the request again after a short time. The aggregation process is usually completed within the next day.
  • out_of_service: The date specified in date is before the aggregation system operation's start date (03/31/2018).

success

Number

Number of messages sent using the LINE notification messages API on the date specified in date. Only included in the response if the value of status is ready.

Example response

# Error response

Returns a JSON object containing error information along with a 4xx HTTP status code. See Error responses in Common specifications.