Appearance
@line/bot-sdk / Exports
@line/bot-sdk
Table of contents
Namespaces
Classes
Interfaces
Type Aliases
- AccountLinkEvent
- Action
- AltURI
- Area
- AudienceGroup
- AudienceGroupAuthorityLevel
- AudienceGroupCreateRoute
- AudienceGroupStatus
- AudienceGroups
- AudioEventMessage
- AudioMessage
- Background
- BeaconEvent
- BotInfoResponse
- ChannelAccessToken
- ContentProvider
- DatetimePickerAction
- DeliveryContext
- DeliveryEvent
- DemographicFilterObject
- DeviceLinkEvent
- DeviceUnlinkEvent
- EventBase
- EventMessage
- EventMessageBase
- EventSource
- FileEventMessage
- FlexBlockStyle
- FlexBox
- FlexBubble
- FlexBubbleStyle
- FlexButton
- FlexCarousel
- FlexComponent
- FlexContainer
- FlexFiller
- FlexIcon
- FlexImage
- FlexMessage
- FlexSeparator
- FlexSpacer
- FlexSpan
- FlexText
- FlexVideo
- FollowEvent
- FriendDemographics
- GetRichMenuAliasListResponse
- GetRichMenuAliasResponse
- Group
- GroupSummaryResponse
- ImageEventMessage
- ImageMapAction
- ImageMapActionBase
- ImageMapMessage
- ImageMapMessageAction
- ImageMapURIAction
- ImageMessage
- InsightStatisticsResponse
- JoinEvent
- LINEThingsActionResult
- LINEThingsScenarioExecutionEvent
- LeaveEvent
- LocationEventMessage
- LocationMessage
- MemberJoinEvent
- MemberLeaveEvent
- MembersCountResponse
- Message
- MessageAPIResponseBase
- MessageAction
- MessageCommon
- MessageEvent
- NarrowcastProgressResponse
- NumberOfFollowers
- NumberOfFollowersResponse
- NumberOfMessageDeliveries
- NumberOfMessageDeliveriesResponse
- NumberOfMessagesSentResponse
- NumberOfMessagesSentThisMonth
- Offset
- Postback
- PostbackAction
- PostbackEvent
- Profile
- QuickReply
- QuickReplyItem
- ReceieptObject
- ReplyableEvent
- RichMenu
- RichMenuResponse
- RichMenuSwitchAction
- Room
- Sender
- Size
- StatisticsPerUnit
- StickerEventMessage
- StickerMessage
- TargetLimitForAdditionalMessages
- TemplateButtons
- TemplateCarousel
- TemplateColumn
- TemplateConfirm
- TemplateContent
- TemplateImageCarousel
- TemplateImageColumn
- TemplateMessage
- TestWebhookEndpointResponse
- TextEventMessage
- TextMessage
- URIAction
- UnfollowEvent
- UnsendEvent
- User
- UserInteractionStatistics
- VerifyAccessToken
- VerifyIDToken
- VideoEventMessage
- VideoMessage
- VideoPlayCompleteEvent
- WebhookEndpointInfoResponse
- WebhookEvent
- WebhookRequestBody
Variables
Functions
Type Aliases
AccountLinkEvent
Ƭ AccountLinkEvent: ReplyableEvent
& { link
: { nonce
: string
; result
: "ok"
| "failed"
} ; type
: "accountLink"
}
Event object for when a user has linked his/her LINE account with a provider's service account.
Defined in
Action
Ƭ Action<ExtraFields
>: PostbackAction
| MessageAction
| URIAction
| DatetimePickerAction
| RichMenuSwitchAction
| { type
: "camera"
} | { type
: "cameraRoll"
} | { type
: "location"
} & ExtraFields
These are types of actions for your bot to take when a user taps a button or an image in a message.
- Postback action
- Message action
- URI action
- Datetime picker action
- Rich menu switch action
- Camera action
- Camera roll action
- Location action
Type parameters
Name | Type |
---|---|
ExtraFields | { label : string } |
Defined in
AltURI
Ƭ AltURI: Object
URI opened on LINE for macOS and Windows when the action is performed (Max: 1000 characters) If the altUri.desktop property is set, the uri property is ignored on LINE for macOS and Windows. The available schemes are http, https, line, and tel. For more information about the LINE URL scheme, see Using the LINE URL scheme. This property is supported on the following version of LINE.
LINE 5.12.0 or later for macOS and Windows Note: The altUri.desktop property is supported only when you set URI actions in Flex Messages.
Type declaration
Name | Type |
---|---|
desktop | string |
Defined in
Area
Ƭ Area: Object
Type declaration
Name | Type | Description |
---|---|---|
height | number | Height of the tappable area |
width | number | Width of the tappable area |
x | number | Horizontal position relative to the top-left corner of the area |
y | number | Vertical position relative to the top-left corner of the area |
Defined in
AudienceGroup
Ƭ AudienceGroup: _AudienceGroup
& { jobs
: AudienceGroupJob
[] }
Defined in
AudienceGroupAuthorityLevel
Ƭ AudienceGroupAuthorityLevel: "PUBLIC"
| "PRIVATE"
Defined in
AudienceGroupCreateRoute
Ƭ AudienceGroupCreateRoute: "OA_MANAGER"
| "MESSAGING_API"
Defined in
AudienceGroupStatus
Ƭ AudienceGroupStatus: "IN_PROGRESS"
| "READY"
| "EXPIRED"
| "FAILED"
Defined in
AudienceGroups
Ƭ AudienceGroups: _AudienceGroup
[]
Defined in
AudioEventMessage
Ƭ AudioEventMessage: { contentProvider
: ContentProvider
<false
> ; duration
: number
; type
: "audio"
} & EventMessageBase
Message object which contains the audio content sent from the source. The binary audio data can be retrieved using Client#getMessageContent.
Defined in
AudioMessage
Ƭ AudioMessage: MessageCommon
& { duration
: number
; originalContentUrl
: string
; type
: "audio"
}
See
Defined in
Background
Ƭ Background: Object
Type declaration
Name | Type | Description |
---|---|---|
angle | string | The angle at which a linear gradient moves. Specify the angle using an integer value like 90deg (90 degrees) or a decimal number like 23.5deg (23.5 degrees) in the half-open interval [0, 360). The direction of the linear gradient rotates clockwise as the angle increases. Given a value of 0deg , the gradient starts at the bottom and ends at the top; given a value of 45deg , the gradient starts at the bottom-left corner and ends at the top-right corner; given a value of 90deg, the gradient starts at the left and ends at the right; and given a value of 180deg , the gradient starts at the top and ends at the bottom. For more information, see Direction (angle) of linear gradient backgrounds in the Messaging API documentation. |
centerColor? | string | The color in the middle of the gradient. Use a hexadecimal color code in the #RRGGBB or #RRGGBBAA format. Specify a value for the background.centerColor property to create a gradient that has three colors. For more information, see Intermediate color stops for linear gradients in the Messaging API documentation. |
centerPosition? | string | The position of the intermediate color stop. Specify an integer or decimal value between 0% (the starting point) and 100% (the ending point). This is 50% by default. For more information, see Intermediate color stops for linear gradients in the Messaging API documentation. |
endColor | string | The color at the gradient's ending point. Use a hexadecimal color code in the #RRGGBB or #RRGGBBAA format. |
startColor | string | The color at the gradient's starting point. Use a hexadecimal color code in the #RRGGBB or #RRGGBBAA format. |
type | "linearGradient" | The type of background used. Specify these values: - linearGradient : Linear gradient. For more information, see Linear gradient backgrounds in the Messaging API documentation. |
Defined in
BeaconEvent
Ƭ BeaconEvent: ReplyableEvent
& { beacon
: { dm?
: string
; hwid
: string
; type
: "enter"
| "leave"
| "banner"
| "stay"
} ; type
: "beacon"
}
Event object for when a user enters or leaves the range of a LINE Beacon.
Defined in
BotInfoResponse
Ƭ BotInfoResponse: Object
Response body of get bot info.
See
Type declaration
Name | Type |
---|---|
basicId | string |
chatMode | "chat" | "bot" |
displayName | string |
markAsReadMode | "auto" | "manual" |
pictureUrl? | string |
premiumId? | string |
userId | string |
Defined in
ChannelAccessToken
Ƭ ChannelAccessToken: Object
Type declaration
Name | Type |
---|---|
access_token | string |
expires_in | number |
key_id? | string |
token_type | "Bearer" |
Defined in
ContentProvider
Ƭ ContentProvider<WithPreview
>: { type
: "line"
} | { originalContentUrl
: string
; previewImageUrl
: WithPreview
extends true
? string
: undefined
; type
: "external"
}
Type parameters
Name | Type |
---|---|
WithPreview | extends boolean = true |
Defined in
DatetimePickerAction
Ƭ DatetimePickerAction: Object
When a control associated with this action is tapped, a postback event is returned via webhook with the date and time selected by the user from the date and time selection dialog.
The datetime picker action does not support time zones.
Date and time format
The date and time formats for the initial
, max
, and min
values are shown below. The full-date
, time-hour
, and time-minute
formats follow the RFC3339 protocol.
Mode | Format | Example |
---|---|---|
date | full-date (Max: 2100-12-31; Min: 1900-01-01) | 2017-06-18 |
time | time-hour :time-minute (Max: 23:59; Min: 00:00) | 00:0006:1523:59 |
datetime | full-date Ttime-hour :time-minute or full-date ttime-hour :time-minute (Max: 2100-12-31T23:59; Min: 1900-01-01T00:00) | 2017-06-18T06:152017-06-18t06:15 |
Type declaration
Name | Type | Description |
---|---|---|
data | string | String returned via webhook in the postback.data property of the postback event (Max: 300 characters) |
initial? | string | Initial value of date or time |
max? | string | Largest date or time value that can be selected. Must be greater than the min value. |
min? | string | Smallest date or time value that can be selected. Must be less than the max value. |
mode | "date" | "time" | "datetime" | - |
type | "datetimepicker" | - |
Defined in
DeliveryContext
Ƭ DeliveryContext: Object
Type declaration
Name | Type |
---|---|
isRedelivery | boolean |
Defined in
DeliveryEvent
Ƭ DeliveryEvent: { delivery
: Delivery
; type
: "delivery"
} & EventBase
Completed Delivery Event
See
Defined in
DemographicFilterObject
Ƭ DemographicFilterObject: DemographicObject
| FilterOperatorObject
<DemographicObject
>
Defined in
DeviceLinkEvent
Ƭ DeviceLinkEvent: ReplyableEvent
& { things
: { deviceId
: string
; type
: "link"
} ; type
: "things"
}
Indicates that a LINE Things-compatible device has been linked with LINE by a user operation. For more information, see Receiving device link events via webhook.
Defined in
DeviceUnlinkEvent
Ƭ DeviceUnlinkEvent: ReplyableEvent
& { things
: { deviceId
: string
; type
: "unlink"
} ; type
: "things"
}
Indicates that a LINE Things-compatible device has been unlinked from LINE by a user operation. For more information, see Receiving device unlink events via webhook.
Defined in
EventBase
Ƭ EventBase: Object
Type declaration
Name | Type | Description |
---|---|---|
deliveryContext | DeliveryContext | Whether the webhook event is a redelivered one or not |
mode | "active" | "standby" | Channel state. active : The channel is active. You can send a reply message or push message from the bot server that received this webhook event. standby : The channel is waiting. The bot server that received this webhook event shouldn't send any messages. |
source | EventSource | Source user, group, or room object with information about the source of the event. |
timestamp | number | Time of the event in milliseconds |
webhookEventId | string | Webhook Event ID, an ID that uniquely identifies a webhook event |
Defined in
EventMessage
Ƭ EventMessage: TextEventMessage
| ImageEventMessage
| VideoEventMessage
| AudioEventMessage
| LocationEventMessage
| FileEventMessage
| StickerEventMessage
Defined in
EventMessageBase
Ƭ EventMessageBase: Object
Type declaration
Name | Type |
---|---|
id | string |
Defined in
EventSource
Ƭ EventSource: User
| Group
| Room
Defined in
FileEventMessage
Ƭ FileEventMessage: { fileName
: string
; fileSize
: string
; type
: "file"
} & EventMessageBase
Message object which contains the file sent from the source. The binary data can be retrieved using Client#getMessageContent.
Defined in
FlexBlockStyle
Ƭ FlexBlockStyle: Object
Type declaration
Name | Type | Description |
---|---|---|
backgroundColor? | string | Background color of the block. Use a hexadecimal color code. |
separator? | boolean | - true to place a separator above the block. - true will be ignored for the first block in a container because you cannot place a separator above the first block. - The default value is false . |
separatorColor? | string | Color of the separator. Use a hexadecimal color code. |
Defined in
FlexBox
Ƭ FlexBox: { action?
: Action
; alignItems?
: "flex-start"
| "center"
| "flex-end"
; background?
: Background
; backgroundColor?
: string
; borderColor?
: string
; borderWidth?
: string
| "none"
| "light"
| "normal"
| "medium"
| "semi-bold"
| "bold"
; contents
: FlexComponent
[] ; cornerRadius?
: string
| "none"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
; flex?
: number
; height?
: string
; justifyContent?
: "flex-start"
| "center"
| "flex-end"
| "space-between"
| "space-around"
| "space-evenly"
; layout
: "horizontal"
| "vertical"
| "baseline"
; margin?
: string
| "none"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
; maxHeight?
: string
; maxWidth?
: string
; paddingAll?
: string
; paddingBottom?
: string
; paddingEnd?
: string
; paddingStart?
: string
; paddingTop?
: string
; spacing?
: string
| "none"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
; type
: "box"
; width?
: string
} & Offset
This is a component that defines the layout of child components. You can also include a box in a box.
Defined in
FlexBubble
Ƭ FlexBubble: Object
This is a container that contains one message bubble. It can contain four blocks: header, hero, body, and footer.
For more information about using each block, see Block.
Type declaration
Name | Type | Description |
---|---|---|
action? | Action | - |
body? | FlexBox | - |
direction? | "ltr" | "rtl" | Text directionality and the order of components in horizontal boxes in the container. Specify one of the following values: - ltr : Left to right - rtl : Right to left The default value is ltr . |
footer? | FlexBox | - |
header? | FlexBox | - |
hero? | FlexBox | FlexImage | FlexVideo | - |
size? | "nano" | "micro" | "kilo" | "mega" | "giga" | - |
styles? | FlexBubbleStyle | - |
type | "bubble" | - |
Defined in
FlexBubbleStyle
Ƭ FlexBubbleStyle: Object
Type declaration
Name | Type |
---|---|
body? | FlexBlockStyle |
footer? | FlexBlockStyle |
header? | FlexBlockStyle |
hero? | FlexBlockStyle |
Defined in
FlexButton
Ƭ FlexButton: { action
: Action
; adjustMode?
: "shrink-to-fit"
; color?
: string
; flex?
: number
; gravity?
: "top"
| "bottom"
| "center"
; height?
: "sm"
| "md"
; margin?
: string
| "none"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
; style?
: "link"
| "primary"
| "secondary"
; type
: "button"
} & Offset
This component draws a button.
When the user taps a button, a specified action is performed.
Defined in
FlexCarousel
Ƭ FlexCarousel: Object
Type declaration
Name | Type | Description |
---|---|---|
contents | FlexBubble [] | (Max: 12 bubbles) |
type | "carousel" | - |
Defined in
FlexComponent
Ƭ FlexComponent: FlexBox
| FlexButton
| FlexImage
| FlexVideo
| FlexIcon
| FlexText
| FlexSpan
| FlexSeparator
| FlexFiller
| FlexSpacer
Components are objects that compose a Flex Message container. Here are the types of components available:
See the followings for the components' JSON data samples and usage.
Defined in
FlexContainer
Ƭ FlexContainer: FlexBubble
| FlexCarousel
A container is the top-level structure of a Flex Message. Here are the types of containers available.
See Flex Message elements for the containers' JSON data samples and usage.
Defined in
FlexFiller
Ƭ FlexFiller: Object
This is an invisible component to fill extra space between components.
- The filler's
flex
property is fixed to 1. - The
spacing
property of the parent box will be ignored for fillers.
Type declaration
Name | Type | Description |
---|---|---|
flex? | number | The ratio of the width or height of this component within the parent box. For more information, see Width and height of components. |
type | "filler" | - |
Defined in
FlexIcon
Ƭ FlexIcon: { aspectRatio?
: string
; margin?
: string
| "none"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
; size?
: string
| "xxs"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
| "3xl"
| "4xl"
| "5xl"
; type
: "icon"
; url
: string
} & Offset
This component draws an icon.
Defined in
FlexImage
Ƭ FlexImage: { action?
: Action
; align?
: "start"
| "end"
| "center"
; animated?
: Boolean
; aspectMode?
: "cover"
| "fit"
; aspectRatio?
: string
; backgroundColor?
: string
; flex?
: number
; gravity?
: "top"
| "bottom"
| "center"
; margin?
: string
| "none"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
; size?
: string
| "xxs"
| "xs"
| "sm"
| "md"
| "lg"
| "xl"
| "xxl"
| "3xl"
| "4xl"
| "5xl"
| "full"
; type
: "image"
; url
: string
} & Offset
This component draws an image.
Defined in
FlexMessage
Ƭ FlexMessage: MessageCommon
& { altText
: string
; contents
: FlexContainer
; type
: "flex"
}
Flex Messages are messages with a customizable layout. You can customize the layout freely by combining multiple elements. For more information, see Using Flex Messages.
See
Defined in
FlexSeparator
Ƭ FlexSeparator: Object
This component draws a separator between components in the parent box.
Type declaration
Name | Type | Description |
---|---|---|
color? | string | Color of the separator. Use a hexadecimal color code. |
margin? | string | "none" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | Minimum space between this box and the previous component in the parent box. - none does not set a space while the other values set a space whose size increases in the order of listing. - The default value is the value of the spacing property of the parent box. - If this box is the first component in the parent box, the margin property will be ignored. |
type | "separator" | - |
Defined in
FlexSpacer
Ƭ FlexSpacer: Object
This is an invisible component that places a fixed-size space at the beginning or end of the box.
Deprecated
Type declaration
Name | Type | Description |
---|---|---|
size? | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | Size of the space. The size increases in the order of listing. The default value is md . |
type | "spacer" | - |
Defined in
FlexSpan
Ƭ FlexSpan: Object
This component renders multiple text strings with different designs in one row. You can specify the color, size, weight, and decoration for the font. Span is set to contents
property in Text.
Type declaration
Name | Type | Description |
---|---|---|
color? | string | Font color. Use a hexadecimal color code. |
decoration? | string | Decoration of the text. Specify one of the following values: none : No decoration underline : Underline line-through : Strikethrough The default value is none . Note: The decoration set in the decoration property of the text cannot be overwritten by the decoration property of the span. |
size? | string | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "3xl" | "4xl" | "5xl" | Font size. You can specify one of the following values: xxs , xs , sm , md , lg , xl , xxl , 3xl , 4xl , or 5xl . The size increases in the order of listing. The default value is md . For more information, see Icon, text, and span size in the Messaging API documentation. |
style? | string | Style of the text. Specify one of the following values: - normal : Normal - italic : Italic The default value is normal . |
text | string | Text. If the wrap property of the parent text is set to true , you can use a new line character (\n ) to begin on a new line. |
type | "span" | - |
weight? | string | Font weight. You can specify one of the following values: regular or bold . Specifying bold makes the font bold. The default value is regular . |
Defined in
FlexText
Ƭ FlexText: FlexTextWithText
| FlexTextWithContents
& Offset
Defined in
FlexVideo
Ƭ FlexVideo: Object
This component draws a video.
Type declaration
Name | Type | Description |
---|---|---|
action? | Action | Action performed when this button is tapped. Specify an action object. |
altContent | FlexBox | FlexImage | Alternative content. The alternative content will be displayed on the screen of a user device that is using a version of LINE that doesn't support the video component. Specify a box or an image. - Protocol: HTTPS (TLS 1.2 or later) - Image format: JPEG or PNG - Maximum data size: 1 MB |
aspectRatio? | string | Aspect ratio of the video. {width}:{height} format. Specify the value of {width} and {height} in the range from 1 to 100000. However, you cannot set {height} to a value that is more than three times the value of {width} . The default value is 1:1 . |
previewUrl | string | Preview image URL (Max character limit: 2000) - Protocol: HTTPS (TLS 1.2 or later) - Image format: JPEG or PNG - Maximum data size: 1 MB |
type | "video" | - |
url | string | Video file URL (Max character limit: 2000) - Protocol: HTTPS (TLS 1.2 or later) - Video format: mp4 - Maximum data size: 200 MB |
Defined in
FollowEvent
Ƭ FollowEvent: { type
: "follow"
} & ReplyableEvent
Event object for when your account is added as a friend (or unblocked).
Defined in
FriendDemographics
Ƭ FriendDemographics: Object
Type declaration
Name | Type | Description |
---|---|---|
ages? | { age : string } & PercentageAble [] | Percentage per age group |
appTypes? | { appType : "ios" | "android" | "others" } & PercentageAble [] | Percentage by OS |
areas? | { area : string } & PercentageAble [] | Percentage per area |
available | boolean | true if friend demographic information is available. |
genders? | { gender : "unknown" | "male" | "female" } & PercentageAble [] | Percentage per gender |
subscriptionPeriods? | { subscriptionPeriod : "over365days" | "within365days" | "within180days" | "within90days" | "within30days" | "within7days" | "unknown" } & PercentageAble [] | Percentage per friendship duration |
Defined in
GetRichMenuAliasListResponse
Ƭ GetRichMenuAliasListResponse: Object
Type declaration
Name | Type |
---|---|
aliases | GetRichMenuAliasResponse [] |
Defined in
GetRichMenuAliasResponse
Ƭ GetRichMenuAliasResponse: Object
Type declaration
Name | Type |
---|---|
richMenuAliasId | string |
richMenuId | string |
Defined in
Group
Ƭ Group: Object
Type declaration
Name | Type | Description |
---|---|---|
groupId | string | - |
type | "group" | - |
userId? | string | ID of the source user. Only included in message events. Not included if the user has not agreed to the Official Accounts Terms of Use. |
Defined in
GroupSummaryResponse
Ƭ GroupSummaryResponse: Object
Response body of get group summary.
See
Type declaration
Name | Type |
---|---|
groupId | string |
groupName | string |
pictureUrl? | string |
Defined in
ImageEventMessage
Ƭ ImageEventMessage: { contentProvider
: ContentProvider
; imageSet?
: { id
: string
; index
: number
; total
: number
} ; type
: "image"
} & QuotableMessage
& EventMessageBase
Message object which contains the image content sent from the source. The binary image data can be retrieved using Client#getMessageContent.
Defined in
ImageMapAction
Ƭ ImageMapAction: ImageMapURIAction
| ImageMapMessageAction
Object which specifies the actions and tappable regions of an imagemap.
When a region is tapped, the user is redirected to the URI specified in uri
and the message specified in message
is sent.
See
Defined in
ImageMapActionBase
Ƭ ImageMapActionBase: Object
Type declaration
Name | Type | Description |
---|---|---|
area | Area | Defined tappable area |
label? | string | Spoken when the accessibility feature is enabled on the client device. (Max: 50 characters) Supported on LINE 8.2.0 and later for iOS. |
Defined in
ImageMapMessage
Ƭ ImageMapMessage: MessageCommon
& { actions
: ImageMapAction
[] ; altText
: string
; baseSize
: Size
; baseUrl
: string
; type
: "imagemap"
; video?
: { area
: Area
; externalLink?
: { label
: string
; linkUri
: string
} ; originalContentUrl
: string
; previewImageUrl
: string
} }
See
Defined in
ImageMapMessageAction
Ƭ ImageMapMessageAction: { text
: string
; type
: "message"
} & ImageMapActionBase
Defined in
ImageMapURIAction
Ƭ ImageMapURIAction: { linkUri
: string
; type
: "uri"
} & ImageMapActionBase
Defined in
ImageMessage
Ƭ ImageMessage: MessageCommon
& { originalContentUrl
: string
; previewImageUrl
: string
; type
: "image"
}
See
Defined in
InsightStatisticsResponse
Ƭ InsightStatisticsResponse: Object
Type declaration
Name | Type | Description |
---|---|---|
status | "ready" | "unready" | "out_of_service" | Calculation status. One of: - ready : Calculation has finished; the numbers are up-to-date. - unready : We haven't finished calculating the number of sent messages for the specified date . Calculation usually takes about a day. Please try again later. - out_of_service : The specified date is earlier than the date on which we first started calculating sent messages. Different APIs have different date. Check them at the document. |
Defined in
JoinEvent
Ƭ JoinEvent: { type
: "join"
} & ReplyableEvent
Event object for when your bot joins a group or room. You can reply to join events.
A join event is triggered at different times for groups and rooms.
- For groups: A join event is sent when a user invites your bot.
- For rooms: A join event is sent when the first event (for example when a user sends a message or is added to the room) occurs after your bot is added.
Defined in
LINEThingsActionResult
Ƭ LINEThingsActionResult: Object
Type declaration
Name | Type | Description |
---|---|---|
data? | string | Base64-encoded binary data This property is always included when things.actionResults[].type is binary . |
type | "void" | "binary" | void , binary Depends on type of the executed action. This property is always included if things.actionResults is not empty. |
Defined in
LINEThingsScenarioExecutionEvent
Ƭ LINEThingsScenarioExecutionEvent: ReplyableEvent
& { things
: { deviceId
: string
; result
: { actionResults
: LINEThingsActionResult
[] ; bleNotificationPayload?
: string
; endtime
: number
; errorReason?
: string
; resultCode
: "success"
| "gatt_error"
| "runtime_error"
; revision
: number
; scenarioId
: string
; startTime
: number
} ; type
: "scenarioResult"
} ; type
: "things"
}
Defined in
LeaveEvent
Ƭ LeaveEvent: { type
: "leave"
} & EventBase
Event object for when a user removes your bot from a group or a room.
Defined in
LocationEventMessage
Ƭ LocationEventMessage: { address
: string
; latitude
: number
; longitude
: number
; title
: string
; type
: "location"
} & EventMessageBase
Message object which contains the location data sent from the source.
Defined in
LocationMessage
Ƭ LocationMessage: MessageCommon
& { address
: string
; latitude
: number
; longitude
: number
; title
: string
; type
: "location"
}
See
Defined in
MemberJoinEvent
Ƭ MemberJoinEvent: { joined
: { members
: User
[] } ; type
: "memberJoined"
} & ReplyableEvent
Event object for when a user joins a group or room that the bot is in.
Defined in
MemberLeaveEvent
Ƭ MemberLeaveEvent: { left
: { members
: User
[] } ; type
: "memberLeft"
} & EventBase
Event object for when a user leaves a group or room that the bot is in.
Defined in
MembersCountResponse
Ƭ MembersCountResponse: Object
Response body of get members in group count and get members in room count.
See
Type declaration
Name | Type |
---|---|
count | number |
Defined in
Message
Ƭ Message: TextMessage
| ImageMessage
| VideoMessage
| AudioMessage
| LocationMessage
| StickerMessage
| ImageMapMessage
| TemplateMessage
| FlexMessage
JSON object which contains the contents of the message you send.
See
Defined in
MessageAPIResponseBase
Ƭ MessageAPIResponseBase: Object
Type declaration
Name | Type |
---|---|
x-line-request-id? | string |
Defined in
MessageAction
Ƭ MessageAction: Object
When a control associated with this action is tapped, the string in the text property is sent as a message from the user.
Type declaration
Name | Type | Description |
---|---|---|
text | string | Text sent when the action is performed (Max: 300 characters) |
type | "message" | - |
Defined in
MessageCommon
Ƭ MessageCommon: Object
See
Common properties for messages
Type declaration
Name | Type | Description |
---|---|---|
quickReply? | QuickReply | For the quick reply feature. For more information, see Using quick replies. If the user receives multiple message objects, the quickReply property of the last message object is displayed. |
sender? | Sender | Change icon and display name When sending a message from the LINE Official Account, you can specify the sender.name and the sender.iconUrl properties in Message objects. |
Defined in
MessageEvent
Ƭ MessageEvent: { message
: EventMessage
; type
: "message"
} & ReplyableEvent
Webhook event object which contains the sent message.
The message
property contains a message object which corresponds with the message type. You can reply to message events.
See
Defined in
NarrowcastProgressResponse
Ƭ NarrowcastProgressResponse: { phase
: "waiting"
} | { phase
: "sending"
| "succeeded"
} | { failedDescription
: string
; phase
: "failed"
} & { acceptedTime
: string
; completedTime
: string
; failureCount
: number
; successCount
: number
; targetCount
: string
} & { errorCode?
: 1
| 2
}
Defined in
NumberOfFollowers
Ƭ NumberOfFollowers: InsightStatisticsResponse
& { blocks
: Number
; followers
: Number
; targetedReaches
: Number
}
Defined in
NumberOfFollowersResponse
Ƭ NumberOfFollowersResponse: InsightStatisticsResponse
| NumberOfFollowers
Defined in
NumberOfMessageDeliveries
Ƭ NumberOfMessageDeliveries: InsightStatisticsResponse
& { apiBroadcast
: number
; apiMulticast
: number
; apiPush
: number
; apiReply
: number
; autoResponse
: number
; broadcast
: number
; chat
: number
; targeting
: number
; welcomeResponse
: number
}
Defined in
NumberOfMessageDeliveriesResponse
Ƭ NumberOfMessageDeliveriesResponse: InsightStatisticsResponse
| NumberOfMessageDeliveries
Defined in
NumberOfMessagesSentResponse
Ƭ NumberOfMessagesSentResponse: InsightStatisticsResponse
& { success?
: number
}
Defined in
NumberOfMessagesSentThisMonth
Ƭ NumberOfMessagesSentThisMonth: Object
Type declaration
Name | Type | Description |
---|---|---|
totalUsage | number | The number of sent messages in the current month |
Defined in
Offset
Ƭ Offset: Object
Type declaration
Name | Type | Description |
---|---|---|
offsetBottom? | string | The bottom offset. For more information, see Offset in the API documentation. |
offsetEnd? | string | The right offset. For more information, see Offset in the API documentation. |
offsetStart? | string | The left offset. For more information, see Offset in the API documentation. |
offsetTop? | string | The top offset. For more information, see Offset in the API documentation. |
position? | "relative" | "absolute" | Reference position for placing this box. Specify one of the following values: - relative : Use the previous box as reference. - absolute : Use the top left of parent element as reference. The default value is relative. For more information, see Offset in the API documentation. |
Defined in
Postback
Ƭ Postback: Object
Type declaration
Name | Type |
---|---|
data | string |
params? | DateTimePostback | RichMenuSwitchPostback |
Defined in
PostbackAction
Ƭ PostbackAction: Object
When a control associated with this action is tapped, a postback event is returned via webhook with the specified string in the data property.
Type declaration
Name | Type | Description |
---|---|---|
data | string | String returned via webhook in the postback.data property of the postback event (Max: 300 characters) |
displayText? | string | Text displayed in the chat as a message sent by the user when the action is performed. - Required for quick reply buttons. - Optional for the other message types. Max: 300 characters The displayText and text properties cannot both be used at the same time. |
fillInText? | string | String to be pre-filled in the input field when the keyboard is opened. Valid only when the inputOption property is set to openKeyboard. The string can be broken by a newline character (\n). Max: 300 characters |
inputOption? | "closeRichMenu" | "openRichMenu" | "openKeyboard" | "openVoice" | The display method of such as rich menu based on user action. Specify one of the following values: - closeRichMenu : Close rich menu - openRichMenu : Open rich menu - openKeyboard : Open keyboard - openVoice : Open voice message input mode This property is available on LINE version 12.6.0 or later for iOS or Android. |
text? | string | Text displayed in the chat as a message sent by the user when the action is performed. Returned from the server through a webhook. - This property cannot be used with quick reply buttons. (Max: 300 characters) - The displayText and text properties cannot both be used at the same time. Deprecated |
type | "postback" | - |
Defined in
PostbackEvent
Ƭ PostbackEvent: { postback
: Postback
; type
: "postback"
} & ReplyableEvent
Event object for when a user performs an action on a template message.
Defined in
Profile
Ƭ Profile: Object
Type declaration
Name | Type |
---|---|
displayName | string |
language? | string |
pictureUrl? | string |
statusMessage? | string |
userId | string |
Defined in
QuickReply
Ƭ QuickReply: Object
These properties are used for the quick reply.
For more information, see Using quick replies.
Type declaration
Name | Type | Description |
---|---|---|
items | QuickReplyItem [] | This is a container that contains quick reply buttons. Array of objects (Max: 13) |
Defined in
QuickReplyItem
Ƭ QuickReplyItem: Object
This is a quick reply option that is displayed as a button.
For more information, see quick reply buttons.
Type declaration
Name | Type | Description |
---|---|---|
action | Action | Action performed when this button is tapped. Specify an action object. The following is a list of the available actions: - Postback action - Message action - Datetime picker action - Camera action - Camera roll action - Location action - URI action |
imageUrl? | string | URL of the icon that is displayed at the beginning of the button (Max: 1000 characters) - URL scheme: https - Image format: PNG - Aspect ratio: 1:1 - Data size: Up to 1 MB There is no limit on the image size. If the action property has the following actions with empty imageUrl : - camera action - camera roll action - location action the default icon is displayed. |
type | "action" | - |
Defined in
ReceieptObject
Ƭ ReceieptObject: AudienceObject
| RedeliveryObject
| FilterOperatorObject
<AudienceObject
> | FilterOperatorObject
<RedeliveryObject
>
Defined in
ReplyableEvent
Ƭ ReplyableEvent: EventBase
& { replyToken
: string
}
Defined in
RichMenu
Ƭ RichMenu: Object
Rich menus consist of either of these objects.
- Rich menu object without the rich menu ID. Use this object when you create a rich menu.
- Rich menu response object with the rich menu ID. This object is returned when you get a rich menu or get a list of rich menus.
Area objects and action objects are included in these objects.
Type declaration
Name | Type | Description |
---|---|---|
areas | { action : Action <{ label? : string }> ; bounds : Area }[] | Array of area objects which define the coordinates and size of tappable areas (Max: 20 area objects) |
chatBarText | string | Text displayed in the chat bar (Max: 14 characters) |
name | string | Name of the rich menu. This value can be used to help manage your rich menus and is not displayed to users. (Max: 300 characters) |
selected | boolean | true to display the rich menu by default. Otherwise, false . |
size | Size | size object which contains the width and height of the rich menu displayed in the chat. Rich menu images must be one of the following sizes: 2500x1686px or 2500x843px. |
Defined in
RichMenuResponse
Ƭ RichMenuResponse: { richMenuId
: string
} & RichMenu
Defined in
RichMenuSwitchAction
Ƭ RichMenuSwitchAction: Object
When a control associated with this action is tapped, the URI specified in the uri
property is opened.
Type declaration
Name | Type | Description |
---|---|---|
data | string | String returned by the postback.data property of the postback event via a webhook Max character limit: 300 |
label? | string | Action label. Optional for rich menus. Read when the user's device accessibility feature is enabled. Max character limit: 20. Supported on LINE for iOS 8.2.0 or later. |
richMenuAliasId | string | Rich menu alias ID to switch to. |
type | "richmenuswitch" | - |
Defined in
Room
Ƭ Room: Object
Type declaration
Name | Type | Description |
---|---|---|
roomId | string | - |
type | "room" | - |
userId? | string | ID of the source user. Only included in message events. Not included if the user has not agreed to the Official Accounts Terms of Use. |
Defined in
Sender
Ƭ Sender: Object
Type declaration
Name | Type | Description |
---|---|---|
iconUrl? | string | Icon image URL - Max character limit: 1000 - URL scheme: https |
name? | string | Display name - Max character limit: 20 - Certain words such as LINE may not be used. |
Defined in
Size
Ƭ Size: Object
Type declaration
Name | Type |
---|---|
height | number |
width | number |
Defined in
StatisticsPerUnit
Ƭ StatisticsPerUnit: Object
https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit
Type declaration
Name | Type |
---|---|
clicks | UserInteractionStatisticsOfEachURL [] |
messages | UserInteractionStatisticsOfEachMessage [] |
overview | { uniqueClick : number ; uniqueImpression : number ; uniqueMediaPlayed : number ; uniqueMediaPlayed100Percent : number } |
overview.uniqueClick | number |
overview.uniqueImpression | number |
overview.uniqueMediaPlayed | number |
overview.uniqueMediaPlayed100Percent | number |
Defined in
StickerEventMessage
Ƭ StickerEventMessage: { keywords
: string
[] ; packageId
: string
; quotedMessageId?
: string
; stickerId
: string
; stickerResourceType
: "STATIC"
| "ANIMATION"
| "SOUND"
| "ANIMATION_SOUND"
| "POPUP"
| "POPUP_SOUND"
| "CUSTOM"
| "MESSAGE"
; text?
: string
; type
: "sticker"
} & QuotableMessage
& EventMessageBase
Message object which contains the sticker data sent from the source. For a list of basic LINE stickers and sticker IDs, see sticker list.
Defined in
StickerMessage
Ƭ StickerMessage: MessageCommon
& CanQuoteMessage
& { packageId
: string
; stickerId
: string
; type
: "sticker"
}
See
Defined in
TargetLimitForAdditionalMessages
Ƭ TargetLimitForAdditionalMessages: Object
Type declaration
Name | Type | Description |
---|---|---|
type | "none" | "limited" | One of the following values to indicate whether a target limit is set or not. - none : This indicates that a target limit is not set. - limited : This indicates that a target limit is set. |
value? | number | The target limit for additional messages in the current month. This property is returned when the type property has a value of limited . |
Defined in
TemplateButtons
Ƭ TemplateButtons: Object
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.
Type declaration
Name | Type | Description |
---|---|---|
actions | Action [] | Action when tapped (Max: 4) |
imageAspectRatio? | "rectangle" | "square" | Aspect ratio of the image. Specify one of the following values: - rectangle : 1.51:1 - square : 1:1 The default value is rectangle |
imageBackgroundColor? | string | Background color of image. Specify a RGB color value. The default value is #FFFFFF (white). |
imageSize? | "cover" | "contain" | Size of the image. Specify one of the following values: - cover : The image fills the entire image area. Parts of the image that do not fit in the area are not displayed. - contain : The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images. The default value is cover . |
text | string | Message text - Max: 160 characters (no image or title) - Max: 60 characters (message with an image or title) |
thumbnailImageUrl? | string | Image URL (Max: 2000 characters) - HTTPS - JPEG or PNG - Max width: 1024px - Max: 1 MB |
title? | string | Title (Max: 40 characters) |
type | "buttons" | - |
Defined in
TemplateCarousel
Ƭ TemplateCarousel: Object
Template with multiple columns which can be cycled like a carousel. The columns will be shown in order by scrolling horizontally.
Because of the height limitation for carousel 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.
Keep the number of actions consistent for all columns. If you use an image or title for a column, make sure to do the same for all other columns.
Type declaration
Name | Type | Description |
---|---|---|
columns | TemplateColumn [] | Array of columns (Max: 10) |
imageAspectRatio? | "rectangle" | "square" | Aspect ratio of the image. Specify one of the following values: - rectangle : 1.51:1 - square : 1:1 Applies to all columns. The default value is rectangle . |
imageSize? | "cover" | "contain" | Size of the image. Specify one of the following values: - cover : The image fills the entire image area. Parts of the image that do not fit in the area are not displayed. - contain : The entire image is displayed in the image area. A background is displayed in the unused areas to the left and right of vertical images and in the areas above and below horizontal images. Applies to all columns. The default value is cover . |
type | "carousel" | - |
Defined in
TemplateColumn
Ƭ TemplateColumn: Object
Type declaration
Name | Type | Description |
---|---|---|
actions | Action [] | Action when tapped (Max: 3) |
defaultAction? | Action | Action when image is tapped; set for the entire image, title, and text area |
imageBackgroundColor? | string | Background color of image. Specify a RGB color value. The default value is #FFFFFF (white). |
text | string | Message text - Max: 120 characters (no image or title) - Max: 60 characters (message with an image or title) |
thumbnailImageUrl? | string | Image URL (Max: 2000 characters) - HTTPS - JPEG or PNG - Aspect ratio: 1:1.51 - Max width: 1024px - Max: 1 MB |
title? | string | Title (Max: 40 characters) |
Defined in
TemplateConfirm
Ƭ TemplateConfirm: Object
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.
Type declaration
Name | Type | Description |
---|---|---|
actions | Action [] | Action when tapped. Set 2 actions for the 2 buttons |
text | string | Message text (Max: 240 characters) |
type | "confirm" | - |
Defined in
TemplateContent
Ƭ TemplateContent: TemplateButtons
| TemplateConfirm
| TemplateCarousel
| TemplateImageCarousel
Defined in
TemplateImageCarousel
Ƭ TemplateImageCarousel: Object
Template with multiple images which can be cycled like a carousel. The images will be shown in order by scrolling horizontally.
Type declaration
Name | Type | Description |
---|---|---|
columns | TemplateImageColumn [] | Array of columns (Max: 10) |
type | "image_carousel" | - |
Defined in
TemplateImageColumn
Ƭ TemplateImageColumn: Object
Type declaration
Name | Type | Description |
---|---|---|
action | Action <{ label? : string }> | Action when image is tapped |
imageUrl | string | Image URL (Max: 2000 characters) - HTTPS - JPEG or PNG - Aspect ratio: 1:1 - Max width: 1024px - Max: 1 MB |
Defined in
TemplateMessage
Ƭ TemplateMessage: MessageCommon
& { altText
: string
; template
: TemplateContent
; type
: "template"
}
Template messages are messages with predefined layouts which you can customize. For more information, see template messages.
The following template types are available:
See
Defined in
TestWebhookEndpointResponse
Ƭ TestWebhookEndpointResponse: Object
Response body of test webhook endpoint.
See
Type declaration
Name | Type |
---|---|
detail | string |
reason | string |
statusCode | number |
success | boolean |
timestamp | string |
Defined in
TextEventMessage
Ƭ TextEventMessage: { emojis?
: { emojiId
: string
; index
: number
; length
: number
; productId
: string
}[] ; mention?
: { mentionees
: { index
: number
; length
: number
; type
: "user"
| "all"
; userId?
: string
}[] } ; quotedMessageId?
: string
; text
: string
; type
: "text"
} & QuotableMessage
& EventMessageBase
Message object which contains the text sent from the source.
Defined in
TextMessage
Ƭ TextMessage: MessageCommon
& CanQuoteMessage
& { emojis?
: { emojiId
: string
; index
: number
; productId
: string
}[] ; text
: string
; type
: "text"
}
See
Defined in
URIAction
Ƭ URIAction: Object
When a control associated with this action is tapped, the URI specified in the uri
property is opened.
Type declaration
Name | Type | Description |
---|---|---|
altUri? | AltURI | - |
type | "uri" | - |
uri | string | URI opened when the action is performed (Max: 1000 characters). Must start with http , https , or tel . |
Defined in
UnfollowEvent
Ƭ UnfollowEvent: { type
: "unfollow"
} & EventBase
Event object for when your account is blocked.
Defined in
UnsendEvent
Ƭ UnsendEvent: { type
: "unsend"
; unsend
: { messageId
: string
} } & EventBase
Event object for when the user unsends a message in a group or room. Unsend event
Defined in
User
Ƭ User: Object
Type declaration
Name | Type |
---|---|
type | "user" |
userId | string |
Defined in
UserInteractionStatistics
Ƭ UserInteractionStatistics: Object
https://developers.line.biz/en/reference/messaging-api/#get-message-event
Type declaration
Name | Type |
---|---|
clicks | UserInteractionStatisticsOfEachURL [] |
messages | UserInteractionStatisticsOfEachMessage [] |
overview | { delivered : number ; requestId : string ; timestamp : number ; uniqueClick : number ; uniqueImpression : number ; uniqueMediaPlayed : number ; uniqueMediaPlayed100Percent : number } |
overview.delivered | number |
overview.requestId | string |
overview.timestamp | number |
overview.uniqueClick | number |
overview.uniqueImpression | number |
overview.uniqueMediaPlayed | number |
overview.uniqueMediaPlayed100Percent | number |
Defined in
VerifyAccessToken
Ƭ VerifyAccessToken: Object
Type declaration
Name | Type |
---|---|
client_id | string |
expires_in | number |
scope | string |
Defined in
VerifyIDToken
Ƭ VerifyIDToken: Object
Type declaration
Name | Type |
---|---|
amr | string [] |
aud | number |
client_id | string |
email | string |
exp | number |
expires_in | number |
iat | number |
iss | string |
name | string |
nonce | string |
picture | string |
scope | string |
sub | string |
Defined in
VideoEventMessage
Ƭ VideoEventMessage: { contentProvider
: ContentProvider
; type
: "video"
} & QuotableMessage
& EventMessageBase
Message object which contains the video content sent from the source. The binary video data can be retrieved using Client#getMessageContent.
Defined in
VideoMessage
Ƭ VideoMessage: MessageCommon
& { originalContentUrl
: string
; previewImageUrl
: string
; type
: "video"
}
See
Defined in
VideoPlayCompleteEvent
Ƭ VideoPlayCompleteEvent: { type
: "videoPlayComplete"
; videoPlayComplete
: { trackingId
: string
} } & ReplyableEvent
Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE Official Account.
Defined in
WebhookEndpointInfoResponse
Ƭ WebhookEndpointInfoResponse: Object
Response body of get webhook endpoint info.
See
Type declaration
Name | Type |
---|---|
active | boolean |
endpoint | string |
Defined in
WebhookEvent
Ƭ WebhookEvent: MessageEvent
| UnsendEvent
| FollowEvent
| UnfollowEvent
| JoinEvent
| LeaveEvent
| MemberJoinEvent
| MemberLeaveEvent
| PostbackEvent
| VideoPlayCompleteEvent
| BeaconEvent
| AccountLinkEvent
| DeviceLinkEvent
| DeviceUnlinkEvent
| LINEThingsScenarioExecutionEvent
| DeliveryEvent
JSON objects which contain events generated on the LINE Platform.
See
Defined in
WebhookRequestBody
Ƭ WebhookRequestBody: Object
Request body which is sent by webhook.
See
Type declaration
Name | Type | Description |
---|---|---|
destination | string | User ID of a bot that should receive webhook events. The user ID value is a string that matches the regular expression, U[0-9a-f]{32}. |
events | WebhookEvent [] | Information about the event |
Defined in
Variables
LINE_REQUEST_ID_HTTP_HEADER_NAME
• Const
LINE_REQUEST_ID_HTTP_HEADER_NAME: "x-line-request-id"
Defined in
LINE_SIGNATURE_HTTP_HEADER_NAME
• Const
LINE_SIGNATURE_HTTP_HEADER_NAME: "x-line-signature"
Defined in
Functions
middleware
▸ middleware(config
): Middleware
Parameters
Name | Type |
---|---|
config | MiddlewareConfig |
Returns
Middleware
Defined in
validateSignature
▸ validateSignature(body
, channelSecret
, signature
): boolean
Parameters
Name | Type |
---|---|
body | string | Buffer |
channelSecret | string |
signature | string |
Returns
boolean