# Option API reference for corporate customers

Use of optional functions requires an application

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

# Common specifications

# Status code

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

# Mission stickers API

Mission stickers are provided to user 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 is not 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

application/json

Authorization

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

The following 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

The main error messages that are found in the message property of the JSON error responses are shown below.

Message Description
invalid request This message is returned when the request to send a sticker set failed because of the user status. For example:
  • The destination user ID specified in to is invalid.
  • The productId property value is the ID of a user who doesn't belong to the target country of the sticker set specified in the to property.
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 was sent is not within the valid period of the sticker set.

# Send mission stickers (v2)

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

Note

It is 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

application/json

X-Line-ChannelId

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

X-Line-ChannelSecret

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

X-Line-Trusted-User-With-ACL

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 the following properties.

ticketId

String

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

Example response

# Error response

The following 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

The main error messages that are found in the message property of the JSON error responses are shown below.

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 is not registered on the "Security settings" tab in the LINE Developers Console.
CHANNEL_MISSION_STICKER_NOT_USABLE The channel is not granted the required permission for the mission sticker feature.

# Audience Match API

# Rate limits

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

# Message types

All message types of Messaging API can be used.

Unavailable actions

Actions other than URI actions can't be set for the following message types:

If an action other than the URI action is set, no message will be sent. Also, no other messages in the same request are sent.

# Unsupported features

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

# Send a message using mobile advertising ID

Performs targeting delivery based on mobile advertising IDs (IFA: Identifier for Advertisers) owned by users.

Example request

# HTTP request

POST https://api.line.me/v2/bot/ad/message/multicast

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

to

Object

Required

The destination of the message (IFA)

to.type

String

Required

ifa

to.ids

Array

Required

An array of IFA strings
Max message limit: 150

messages

Array

Required

An array of message objects for the messages to be sent
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 message delivery result using mobile advertising ID

Gets the delivery result of the message delivered in "Send message using mobile advertising ID".

Example request

# HTTP request

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

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Query parameters

date

Required

Date the message was sent

  • Format: yyyyMMdd (Example: 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

Number of messages delivered using mobile advertising ID on the date specified in date. The response has this property only when the value of status is ready.

# Send a message using phone number

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

Example request

# HTTP request

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

# Request headers

Content-Type

application/json

Authorization

Bearer {channel access token}

# Request body

to

Array of hashed phone numbers

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

application/json

Authorization

Bearer {channel access token}

# Query parameters

date

Required

Date the message was sent

  • Format: yyyyMMdd (Example: 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

application/json

Authorization

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