Options
All
  • Public
  • Public/Protected
  • All
Menu

LineClient is a client for LINE API calls.

Hierarchy

  • LineClient

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

Readonly accessToken

accessToken: string

The access token used by the client

Readonly axios

axios: AxiosInstance

The underlying axios instance.

Readonly channelSecret

channelSecret: undefined | string

The channel secret used by the client

Readonly dataAxios

dataAxios: AxiosInstance

The underlying axios instance for api-data.line.me APIs.

Methods

broadcast

broadcastRawBody

changeAudienceGroupAuthorityLevel

  • Change the authority level of all audiences created in the same channel.

    • Audiences set to PUBLIC will be available in channels other than the one where you created the audience. For example, it will be available in LINE Official Account Manager, LINE Ad Manager, and all channels the bot is linked to.
    • Audiences set to PRIVATE will be available only in the channel where you created the audience.

    Official document - change authority level

    Parameters

    • authorityLevel: "PUBLIC" | "PRIVATE"

      The authority level for all audiences linked to a channel

      • PUBLIC: The default authority level. Audiences will be available in channels other than the one where you created the audience. For example, it will be available in LINE Official Account Manager, LINE Ad Manager, and all channels the bot is linked to.
      • PRIVATE: Audiences will be available only in the channel where you created the audience.

    Returns Promise<MutationSuccessResponse>

    Returns the HTTP 200 status code.

createClickAudienceGroup

  • Create Click Audience Group

    Creates an audience for click-based retargeting. You can create up to 1,000 audiences.

    A click-based retargeting audience is a collection of users who have clicked a URL contained in a broadcast or narrowcast message.

    Use a request ID to identify the message. The message is sent to any user who has clicked at least one link.

    Official document - create click audience group

    Parameters

    • description: string

      The audience's name. Audience names must be unique. This is case-insensitive, meaning AUDIENCE and audience are considered identical.

      • Max character limit: 120
    • requestId: string

      The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID.

    • options: CreateClickAudienceGroupOptions = {}

      create click audience group options

    Returns Promise<ClickAudienceGroup>

    Returns a ClickAudienceGroup along with the 202 HTTP status code.

createImpAudienceGroup

  • createImpAudienceGroup(description: string, requestId: string): Promise<ImpAudienceGroup>
  • Create Impression-based Audience Group

    Creates an audience for impression-based retargeting. You can create up to 1,000 audiences.

    An impression-based retargeting audience is a collection of users who have viewed a broadcast or narrowcast message.

    Use a request ID to specify the message. The audience will include any user who has viewed at least one message bubble.

    Official document - create imp audience group

    Parameters

    • description: string

      The audience's name. Audience names must be unique. This is case-insensitive, meaning AUDIENCE and audience are considered identical.

      • Max character limit: 120
    • requestId: string

      The request ID of a broadcast or narrowcast message sent in the past 60 days. Each Messaging API request has a request ID.

    Returns Promise<ImpAudienceGroup>

    Returns an ImpAudienceGroup along with the 202 HTTP status code.

createLiffApp

  • createLiffApp(liffApp: LiffApp): Promise<{ liffId: string }>

createRichMenu

  • createRichMenu(richMenu: RichMenu): Promise<{ richMenuId: string }>

createUploadAudienceGroup

  • Create Upload Audience Group

    Creates an audience for uploading user IDs. You can create up to 1,000 audiences.

    Get user IDs via these methods:

    【You must complete additional application forms to specify recipients using Identifiers for Advertisers (IFAs)】

    You must complete some additional application forms before you can use IFAs to specify recipients. For more information, contact your LINE representative or submit an inquiry through the LINE for Business website.

    Official document - create upload audience group

    Parameters

    • description: string

      The audience's name. Audience names must be unique. Note that comparisons are case-insensitive, so the names AUDIENCE and audience are considered identical.

      • Max character limit: 120
    • isIfaAudience: boolean

      If this is false (default), recipients are specified by user IDs. If true, recipients must be specified by IFAs.

    • audiences: Audience[]

      An array of up to 10,000 user IDs or IFAs.

    • options: CreateUploadAudienceGroupOptions = {}

      Create upload audience group options.

    Returns Promise<UploadAudienceGroup>

    Returns an UploadAudienceGroup along with the 202 HTTP status code.

deleteAudienceGroup

deleteDefaultRichMenu

  • deleteDefaultRichMenu(): Promise<{ richMenuId: string }>

deleteLiffApp

  • deleteLiffApp(liffId: string): Promise<void>

deleteRichMenu

downloadRichMenuImage

  • downloadRichMenuImage(richMenuId: string): Promise<undefined | Buffer>

getAllGroupMemberIds

  • getAllGroupMemberIds(groupId: string): Promise<string[]>
  • Get All Member Ids in the Group

    Gets the user IDs of the members of a group that the bot is in. This includes the user IDs of users who have not added the LINE Official Account as a friend or has blocked the LINE Official Account.

    This feature is available only to verified or premium accounts. For more information about account types, see the LINE Account Connect page on the LINE for Business website.

    Official document - get group member profile

    Parameters

    Returns Promise<string[]>

    Returns status code 200 and a JSON object with the following information.

    memberIds:

    • List of user IDs of members in the group. Users of LINE version 7.4.x or earlier are not included in memberIds. For more information, see User consent.

getAllRoomMemberIds

  • getAllRoomMemberIds(roomId: string): Promise<string[]>
  • Get All Member Ids in the Room

    Gets the user IDs of the members of a room that the LINE Official Account is in. This includes the user IDs of users who have not added the LINE Official Account as a friend or have blocked the LINE Official Account.

    This feature is available only to verified or premium accounts. For more information about account types, see the LINE Account Connect page on the LINE for Business website.

    Official document - get room member profile

    Parameters

    Returns Promise<string[]>

    Returns status code 200 and a JSON object with the following information.

    memberIds:

    • List of user IDs of members in the room. Users of LINE version 7.4.x or earlier are not included in memberIds. For more information, see User consent.

getAudienceGroup

getAudienceGroupAuthorityLevel

getAudienceGroups

getBotInfo

getDefaultRichMenu

  • getDefaultRichMenu(): Promise<{ richMenuId: string }>

getFriendDemographics

  • Get Friend Demographics

    Retrieves the demographic attributes for a LINE Official Account's friends. You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH) and Taiwan (TW).

    【LINE Official Account migration】

    You can't call this API with a LINE@ account or LINE Official Account that hasn't been migrated to the account plans implemented on April 18, 2019. Please migrate your account first. For more information, see Migration of LINE@ accounts.

    Not real-time data

    It can take up to 3 days for demographic information to be calculated. This means the information the API returns may be 3 days old. Furthermore, your "Target reach" number must be at least 20 to retrieve demographic information.

    Official document - get number of followers

    Returns Promise<FriendDemographics>

    Returns status code 200 and a FriendDemographics.

getGroupMemberIds

  • getGroupMemberIds(groupId: string, start?: string): Promise<{ memberIds: string[]; next?: string }>
  • Get Group Member Ids

    Gets the user IDs of the members of a group that the bot is in. This includes the user IDs of users who have not added the LINE Official Account as a friend or has blocked the LINE Official Account.

    This feature is available only to verified or premium accounts. For more information about account types, see the LINE Account Connect page on the LINE for Business website.

    Official document - get group member profile

    Parameters

    • groupId: string

      Group ID. Found in the source object of webhook event objects.

    • Optional start: string

      Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.

    Returns Promise<{ memberIds: string[]; next?: string }>

    Returns status code 200 and a JSON object with the following information.

    memberIds:

    • List of user IDs of members in the group. Users of LINE version 7.4.x or earlier are not included in memberIds. For more information, see User consent.
    • Max: 100 user IDs

    next:

    • A continuation token to get the next array of user IDs of the members in the group. Returned only when there are remaining user IDs that were not returned in memberIds in the original request.

getGroupMemberProfile

  • getGroupMemberProfile(groupId: string, userId: string): Promise<User>
  • Get Group Member Profile

    Gets the user profile of a member of a group that the LINE Official Account is in if the user ID of the group member is known. You can get user profiles of users who have not added the LINE Official Account as a friend or have blocked the LINE Official Account.

    Official document - get group member profile

    Parameters

    Returns Promise<User>

    Returns status code 200 and a JSON object with the following information.

    displayName:

    • User's display name

    userId:

    • User ID

    pictureUrl:

    • Profile image URL. "https" image URL. Not included in the response if the user doesn't have a profile image.

getGroupMembersCount

  • getGroupMembersCount(groupId: string): Promise<number>
  • Get Members In Group Count

    Gets the count of members in a group. You can get the member in group count even if the user hasn't added the LINE Official Account as a friend or has blocked the LINE Official Account.

    Official document - get members in group count

    Parameters

    Returns Promise<number>

    Returns status code 200 and a number representing group member count.

    count:

    • The count of members in the group. The number returned excludes the LINE Official Account.

getGroupSummary

  • getGroupSummary(groupId: string): Promise<Group>

getLiffAppList

  • getLiffAppList(): Promise<LiffApp[]>

getLinkToken

  • getLinkToken(userId: string): Promise<string>

getLinkedRichMenu

  • getLinkedRichMenu(userId: string): Promise<{ richMenuId: string }>

getMessageContent

  • getMessageContent(messageId: string): Promise<Buffer>
  • Get Message Content

    Gets images, videos, audio, and files sent by users.

    【No API for retrieving text】

    You can't use the Messaging API to retrieve text sent by users.

    Official document - get content

    Parameters

    • messageId: string

      Message ID

    Returns Promise<Buffer>

    Returns status code 200 and the content in binary.

    Content is automatically deleted after a certain period from when the message was sent. There is no guarantee for how long content is stored.

getMessageContentStream

  • getMessageContentStream(messageId: string): Promise<Readable>

getNarrowcastProgress

  • Get Narrowcast Message Status

    Gets the status of a narrowcast message.

    【LINE Official Account migration】

    You can't call this API with a LINE@ account or LINE Official Account that hasn't been migrated to the account plans implemented on April 18, 2019. Please migrate your account first. For more information, see Migration of LINE@ accounts.

    【Messages must have a minimum number of recipients】

    Narrowcast messages cannot be sent when the number of recipients is below a certain minimum amount, to prevent someone from guessing the recipients' attributes. The minimum number of recipients is a private value defined by the LINE Platform.

    【Window of availability for status requests】

    You can get the status of a narrowcast message for up to 7 days after you have requested that it be sent.

    Official document - get narrowcast progress status

    Parameters

    • requestId: string

      The narrowcast message's request ID. Each Messaging API request has a request ID.

    Returns Promise<NarrowcastProgressResponse>

    Returns a 200 HTTP status code and a NarrowcastProgressResponse

getNumberOfFollowers

getNumberOfMessageDeliveries

getNumberOfMessagesSentThisMonth

  • Get Number of Messages Sent This Month

    Gets the number of messages sent in the current month.

    The number of messages retrieved by this operation includes the number of messages sent from LINE Official Account Manager.

    The number of messages retrieved by this operation is approximate. To get the correct number of sent messages, use LINE Official Account Manager or execute API operations for getting the number of sent messages.

    Note: LINE@ accounts cannot call this API endpoint.

    Official document - get consumption

    Returns Promise<NumberOfMessagesSentThisMonth>

    Returns status code 200 and a NumberOfMessagesSentThisMonth.

getNumberOfSentBroadcastMessages

getNumberOfSentMulticastMessages

getNumberOfSentPushMessages

getNumberOfSentReplyMessages

getRichMenu

  • getRichMenu(richMenuId: string): Promise<RichMenu>

getRichMenuList

getRoomMemberIds

  • getRoomMemberIds(roomId: string, start?: string): Promise<{ memberIds: string[]; next?: string }>
  • Get Room Member Ids

    Gets the user IDs of the members of a room that the LINE Official Account is in. This includes the user IDs of users who have not added the LINE Official Account as a friend or have blocked the LINE Official Account.

    This feature is available only to verified or premium accounts. For more information about account types, see the LINE Account Connect page on the LINE for Business website.

    Official document - get room member profile

    Parameters

    • roomId: string

      Room ID. Found in the source object of webhook event objects.

    • Optional start: string

      Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.

    Returns Promise<{ memberIds: string[]; next?: string }>

    Returns status code 200 and a JSON object with the following information.

    memberIds:

    • List of user IDs of members in the room. Users of LINE version 7.4.x or earlier are not included in memberIds. For more information, see User consent.
    • Max: 100 user IDs

    next:

    • A continuation token to get the next array of user IDs of the members in the room. Returned only when there are remaining user IDs that were not returned in memberIds in the original request.

getRoomMemberProfile

  • getRoomMemberProfile(roomId: string, userId: string): Promise<User>
  • Get Room Member Profile

    Gets the user profile of a member of a room that the LINE Official Account is in if the user ID of the room member is known. You can get user profiles of users who have not added the LINE Official Account as a friend or have blocked the LINE Official Account.

    Official document - get room member profile

    Parameters

    Returns Promise<User>

    Returns status code 200 and a JSON object with the following information.

    displayName:

    • User's display name

    userId:

    • User ID

    pictureUrl:

    • Profile image URL. "https" image URL. Not included in the response if the user doesn't have a profile image.

getRoomMembersCount

  • getRoomMembersCount(roomId: string): Promise<number>
  • Get Members In Room Count

    Gets the count of members in a room. You can get the member in room count even if the user hasn't added the LINE Official Account as a friend or has blocked the LINE Official Account.

    Official document - get members in room count

    Parameters

    Returns Promise<number>

    Returns status code 200 and a number representing room member count.

    count:

    • The count of members in the group. The number returned excludes the LINE Official Account.

getTargetLimitForAdditionalMessages

getUserProfile

  • getUserProfile(userId: string): Promise<User>
  • Get User Profile

    Gets user profile information.

    Official document - get user profile

    Parameters

    • userId: string

      User ID that is returned in a webhook event object. Do not use the LINE ID found on LINE.Message IDUser ID that is returned in a webhook event object. Do not use the LINE ID found on LINE.

    Returns Promise<User>

    Returns status code 200 and a JSON object with the following information.

    displayName:

    • User's display name

    userId:

    • User ID

    pictureUrl:

    • Profile image URL. "https" image URL. Not included in the response if the user doesn't have a profile image.

    statusMessage:

    • User's status message. Not included in the response if the user doesn't have a status message.

getWebhookEndpointInfo

issueLinkToken

  • issueLinkToken(userId: string): Promise<{ linkToken: string }>
  • issueLinkToken is deprecated. Use getLinkToken instead. Note: It returns a string instead of an object.

    Parameters

    • userId: string

    Returns Promise<{ linkToken: string }>

leaveGroup

leaveRoom

linkRichMenu

multicast

multicastAudio

  • Multicast Audio Message

    Parameters

    • to: string[]

      Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE.

      • Max: 150 user IDs
    • audio: { duration: number; originalContentUrl: string }

      Audio

      • duration: number

        Length of audio file (milliseconds)

      • originalContentUrl: string

        URL of audio file

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • m4a
        • Max: 1 minute
        • Max: 10 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

multicastButtonTemplate

multicastButtonsTemplate

  • Multicast Button Template Message

    Template with an image, title, text, and multiple action buttons.

    Because of the height limitation for buttons template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

    Official document - button template message

    Parameters

    • to: string[]

      Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE.

      • Max: 150 user IDs
    • altText: string

      Alternative text

    • buttonTemplate: Omit<ButtonsTemplate, "type">

      Button template object

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

multicastCarouselTemplate

multicastConfirmTemplate

  • Multicast Confirm Template Message

    Template with two action buttons.

    Because of the height limitation for confirm template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

    Official document - confirm template message

    Parameters

    • to: string[]

      Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE.

      • Max: 150 user IDs
    • altText: string

      Alternative text

    • confirmTemplate: Omit<ConfirmTemplate, "type">

      Confirm template object

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

multicastFlex

multicastImage

  • Multicast Image Message

    Parameters

    • to: string[]

      Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE.

      • Max: 150 user IDs
    • image: { originalContentUrl: string; previewImageUrl?: string }

      Image

      • originalContentUrl: string

        Image URL

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 4096 x 4096
        • Max: 1 MB
      • Optional previewImageUrl?: string

        Preview image URL

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 240 x 240
        • Max: 1 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

multicastImageCarouselTemplate

multicastImagemap

  • Multicast Imagemap Message

    Imagemap messages are messages configured with an image that has multiple tappable areas. You can assign one tappable area for the entire image or different tappable areas on divided areas of the image.

    You can also play a video on the image and display a label with a hyperlink after the video is finished.

    Official document - imagemap message

    Parameters

    • to: string[]

      Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE.

      • Max: 150 user IDs
    • altText: string

      Alternative text

    • imagemap: Omit<ImagemapMessage, "type" | "altText">

      Imagemap

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

multicastLocation

multicastMessages

multicastRawBody

multicastSticker

multicastTemplate

multicastText

multicastVideo

  • Multicast Video Message

    Parameters

    • to: string[]

      Array of user IDs. Use userId values which are returned in webhook event objects. Do not use LINE IDs found on LINE.

      • Max: 150 user IDs
    • video: { originalContentUrl: string; previewImageUrl: string }

      Video

      • originalContentUrl: string

        URL of video file

        A very wide or tall video may be cropped when played in some environments.

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • mp4
        • Max: 1 minute
        • Max: 10 MB
      • previewImageUrl: string

        URL of preview image

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 240 x 240
        • Max: 1 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

narrowcast

  • Send Narrowcast Message

    Sends a push message to multiple users. You can specify recipients using attributes (such as age, gender, OS, and region) or by retargeting (audiences). Messages cannot be sent to groups or rooms.

    LINE Official Account migration

    You can't call this API with a LINE@ account or LINE Official Account that hasn't been migrated to the account plans implemented on April 18, 2019. Please migrate your account first. For more information, see Migration of LINE@ accounts.

    Official document - send narrowcast message

    Parameters

    Returns Promise<{ requestId: string }>

    Returns the 202 HTTP status code and a JSON object with the following information.

    requestId: string

    • The narrowcast message's request ID

    For more information on how to check the status of a narrowcast message, see Get narrowcast message status.

narrowcastMessages

  • Send Narrowcast Message

    Sends a push message to multiple users. You can specify recipients using attributes (such as age, gender, OS, and region) or by retargeting (audiences). Messages cannot be sent to groups or rooms.

    LINE Official Account migration

    You can't call this API with a LINE@ account or LINE Official Account that hasn't been migrated to the account plans implemented on April 18, 2019. Please migrate your account first. For more information, see Migration of LINE@ accounts.

    Official document - send narrowcast message

    Parameters

    Returns Promise<{ requestId: string }>

    Returns the 202 HTTP status code and a JSON object with the following information.

    requestId: string

    • The narrowcast message's request ID

    For more information on how to check the status of a narrowcast message, see Get narrowcast message status.

narrowcastRawBody

  • Send Narrowcast Message

    Sends a push message to multiple users. You can specify recipients using attributes (such as age, gender, OS, and region) or by retargeting (audiences). Messages cannot be sent to groups or rooms.

    LINE Official Account migration

    You can't call this API with a LINE@ account or LINE Official Account that hasn't been migrated to the account plans implemented on April 18, 2019. Please migrate your account first. For more information, see Migration of LINE@ accounts.

    Official document - send narrowcast message

    Parameters

    • body: { filter?: { demographic: DemographicFilterObject }; limit?: { max: number }; messages: Message[]; recipient?: RecipientObject }

      Request body

      • Optional filter?: { demographic: DemographicFilterObject }

        demographic:

        If this is omitted, messages are sent to everyone—including users with attribute values of "unknown".

      • Optional limit?: { max: number }

        max:

        • The maximum number of narrowcast messages to send.
        • Use this parameter to limit the number of narrowcast messages sent. The recipients will be chosen at random.
        • max: number
      • messages: Message[]

        Messages to send

        • Max: 5
      • Optional recipient?: RecipientObject

        RecipientObject. You can specify recipients of the message using up to 10 audiences.

        If this is omitted, messages will be sent to all users who have added your LINE Official Account as a friend.

    Returns Promise<{ requestId: string }>

    Returns the 202 HTTP status code and a JSON object with the following information.

    requestId: string

    • The narrowcast message's request ID

    For more information on how to check the status of a narrowcast message, see Get narrowcast message status.

push

pushAudio

  • Parameters

    • to: string

      ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on LINE.

    • audio: { duration: number; originalContentUrl: string }

      Audio

      • duration: number

        Length of audio file (milliseconds)

      • originalContentUrl: string

        URL of audio file

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • m4a
        • Max: 1 minute
        • Max: 10 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

pushButtonTemplate

pushButtonsTemplate

  • Push Button Template Message

    Template with an image, title, text, and multiple action buttons.

    Because of the height limitation for buttons template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

    Official document - button template message

    Parameters

    • to: string

      ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on LINE.

    • altText: string

      Alternative text

    • buttonTemplate: Omit<ButtonsTemplate, "type">

      Button template object

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

pushCarouselTemplate

pushConfirmTemplate

  • Push Confirm Template Message

    Template with two action buttons.

    Because of the height limitation for confirm template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

    Official document - confirm template message

    Parameters

    • to: string

      ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on LINE.

    • altText: string

      Alternative text

    • confirmTemplate: Omit<ConfirmTemplate, "type">

      Confirm template object

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

pushFlex

pushImage

  • Parameters

    • to: string

      ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on LINE.

    • image: { originalContentUrl: string; previewImageUrl?: string }

      Image

      • originalContentUrl: string

        Image URL

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 4096 x 4096
        • Max: 1 MB
      • Optional previewImageUrl?: string

        Preview image URL

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 240 x 240
        • Max: 1 MB
    • options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

pushImageCarouselTemplate

pushImagemap

  • Push Imagemap Message

    Imagemap messages are messages configured with an image that has multiple tappable areas. You can assign one tappable area for the entire image or different tappable areas on divided areas of the image.

    You can also play a video on the image and display a label with a hyperlink after the video is finished.

    Official document - imagemap message

    Parameters

    • to: string

      ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on LINE.

    • altText: string

      Alternative text

    • imagemap: Omit<ImagemapMessage, "type" | "altText">

      Imagemap

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

pushLocation

pushMessages

pushRawBody

pushSticker

pushTemplate

pushText

pushVideo

  • Parameters

    • to: string

      ID of the target recipient. Use a userId, groupId, or roomId value returned in a webhook event object. Do not use the LINE ID found on LINE.

    • video: { originalContentUrl: string; previewImageUrl: string }

      Video

      • originalContentUrl: string

        URL of video file

        A very wide or tall video may be cropped when played in some environments.

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • mp4
        • Max: 1 minute
        • Max: 10 MB
      • previewImageUrl: string

        URL of preview image

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 240 x 240
        • Max: 1 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

reply

  • Reply Message

    Sends a reply message in response to an event from a user, group, or room.

    To send reply messages, you must have a reply token which is included in a webhook event object.

    Webhooks are used to notify you when an event occurs. For events that you can respond to, a reply token is issued for replying to messages.

    Because the reply token becomes invalid after a certain period of time, responses should be sent as soon as a message is received. Reply tokens can only be used once.

    Official document - send reply message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • messages: Message[]

      Messages to send (Max: 5)

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replyAudio

  • Reply Audio Message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • audio: { duration: number; originalContentUrl: string }

      Audio

      • duration: number

        Length of audio file (milliseconds)

      • originalContentUrl: string

        URL of audio file

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • m4a
        • Max: 1 minute
        • Max: 10 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replyButtonTemplate

replyButtonsTemplate

  • Reply Button Template Message

    Template with an image, title, text, and multiple action buttons.

    Because of the height limitation for buttons template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

    Official document - button template message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • altText: string

      Alternative text

    • buttonTemplate: Omit<ButtonsTemplate, "type">

      Button template object

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replyCarouselTemplate

replyConfirmTemplate

  • Reply Confirm Template Message

    Template with two action buttons.

    Because of the height limitation for confirm template messages, the lower part of the text display area will get cut off if the height limitation is exceeded. For this reason, depending on the character width, the message text may not be fully displayed even when it is within the character limits.

    Official document - confirm template message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • altText: string

      Alternative text

    • confirmTemplate: Omit<ConfirmTemplate, "type">

      Confirm template object

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replyFlex

replyImage

  • Reply Image Message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • image: { originalContentUrl: string; previewImageUrl?: string }

      Image

      • originalContentUrl: string

        Image URL

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 4096 x 4096
        • Max: 1 MB
      • Optional previewImageUrl?: string

        Preview image URL

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 240 x 240
        • Max: 1 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replyImageCarouselTemplate

replyImagemap

  • Reply Imagemap Message

    Imagemap messages are messages configured with an image that has multiple tappable areas. You can assign one tappable area for the entire image or different tappable areas on divided areas of the image.

    You can also play a video on the image and display a label with a hyperlink after the video is finished.

    Official document - imagemap message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • altText: string

      Alternative text

    • imagemap: Omit<ImagemapMessage, "type" | "altText">

      Imagemap

    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replyLocation

replyMessages

  • Reply Message

    Sends a reply message in response to an event from a user, group, or room.

    To send reply messages, you must have a reply token which is included in a webhook event object.

    Webhooks are used to notify you when an event occurs. For events that you can respond to, a reply token is issued for replying to messages.

    Because the reply token becomes invalid after a certain period of time, responses should be sent as soon as a message is received. Reply tokens can only be used once.

    Official document - send reply message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • messages: Message[]

      Messages to send (Max: 5)

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replyRawBody

  • Reply Message Sends a reply message in response to an event from a user, group, or room.

    To send reply messages, you must have a reply token which is included in a webhook event object.

    Webhooks are used to notify you when an event occurs. For events that you can respond to, a reply token is issued for replying to messages.

    Because the reply token becomes invalid after a certain period of time, responses should be sent as soon as a message is received. Reply tokens can only be used once.

    Official document

    Parameters

    • body: { messages: Message[]; replyToken: string }

      Request body

      • messages: Message[]

        Messages to send (Max: 5)

      • replyToken: string

        Reply token received via webhook

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

replySticker

replyTemplate

replyText

replyVideo

  • Reply Video Message

    Parameters

    • replyToken: string

      Reply token received via webhook

    • video: { originalContentUrl: string; previewImageUrl: string }

      Video

      • originalContentUrl: string

        URL of video file

        A very wide or tall video may be cropped when played in some environments.

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • mp4
        • Max: 1 minute
        • Max: 10 MB
      • previewImageUrl: string

        URL of preview image

        • Max character limit: 1000
        • HTTPS over TLS 1.2 or later
        • JPEG
        • Max: 240 x 240
        • Max: 1 MB
    • Optional options: MessageOptions

      Common properties for messages

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

retrieveMessageContent

  • retrieveMessageContent(messageId: string): Promise<Buffer>

setDefaultRichMenu

setDescriptionAudienceGroup

  • setDescriptionAudienceGroup(description: string, audienceGroupId: number): Promise<void>

setWebhookEndpointUrl

testWebhookEndpoint

unlinkRichMenu

updateLiffApp

updateUploadAudienceGroup

  • Create Upload Audience Group

    Adds new user IDs or IFAs to an audience for uploading user IDs.

    【Request timeout values】

    We strongly recommend using request timeout values of 30 seconds or more.

    【You can't switch between user IDs and IFAs】

    Add the same type of data (user IDs or IFAs) to an audience for uploading user IDs as you originally specified when creating that audience. For example, you can't add user IDs to an audience that originally used IFAs when it was created.

    You can use an audience's isIfaAudience property to determine which type of recipient (user IDs or IFAs) was specified when the audience was created. For more details, see Get audience data.

    【You can't delete user IDs or IFAs】

    You cannot delete a user ID or IFA after adding it.

    Official document - update upload audience group

    Parameters

    Returns Promise<MutationSuccessResponse>

    Returns the HTTP 202 status code.

uploadRichMenuImage

  • Upload Rich Menu Image

    Uploads and attaches an image to a rich menu.

    You can use rich menu images with the following specifications:

    • Image format: JPEG or PNG
    • Image size (pixels): 2500x1686, 2500x843, 1200x810, 1200x405, 800x540, 800x270
    • Max file size: 1 MB

    Note: You cannot replace an image attached to a rich menu. To update your rich menu image, create a new rich menu object and upload another image.

    Official document - upload rich menu image

    Parameters

    • richMenuId: string

      The ID of the rich menu to attach the image to

    • image: Buffer

      image

    Returns Promise<MutationSuccessResponse>

    Returns status code 200 and an empty JSON object.

Static connect

Generated using TypeDoc