LINEBot

A client class of LINE Messaging API.
Methods Summary
public
# __construct( LINE\LINEBot\HTTPClient $httpClient , array $args )
LINEBot constructor.
public
# getBotInfo( )
Get basic information about bot.
public
# getProfile( string $userId )
Gets specified user's profile through API calling.
public
# getMessageContent( string $messageId )
Gets message content which is associated with specified message ID.
public
# getNumberOfLimitForAdditional( )
Gets the target limit for additional messages in the current month.
public
# getNumberOfSentThisMonth( )
Gets the number of messages sent in the current month.
public
# replyMessage( string $replyToken , LINE\LINEBot\MessageBuilder $messageBuilder )
Replies arbitrary message to destination which is associated with reply token.
public
# replyText( string $replyToken , string $text , string[]|null $extraTexts = NULL )
Replies text message(s) to destination which is associated with reply token. This method receives variable texts. It can send text(s) message as bulk. Exact signature of this method is <code>replyText(string $replyToken, string $text, string[] $extraTexts)</code>. Means, this method can also receive multiple texts like so; <code> $bot->replyText('reply-text', 'text', 'extra text1', 'extra text2', ...) </code>
public
# pushMessage( string $to , LINE\LINEBot\MessageBuilder $messageBuilder , bool $notificationDisabled = false, string|null $retryKey = NULL )
Sends arbitrary message to destination.
public
# multicast( array $tos , LINE\LINEBot\MessageBuilder $messageBuilder , bool $notificationDisabled = false, string|null $retryKey = NULL )
Sends arbitrary message to multi destinations.
public
# broadcast( LINE\LINEBot\MessageBuilder $messageBuilder , bool $notificationDisabled = false, string|null $retryKey = NULL )
Sends push messages to multiple users at any time. LINE@ accounts cannot call this API endpoint. Please migrate it to a LINE official account.
public
# leaveGroup( string $groupId )
Leaves from group.
public
# leaveRoom( string $roomId )
Leaves from room.
public
# parseEventRequest( string $body , string $signature , bool $eventOnly = true )
Parse event request to Event objects.
public
# validateSignature( string $body , string $signature )
Validate request with signature.
public
# getGroupMemberProfile( string $groupId , string $userId )
Gets the user profile of a member of a group that the bot is in. This can be the user ID of a user who has not added the bot as a friend or has blocked the bot.
public
# getRoomMemberProfile( string $roomId , string $userId )
Gets the user profile of a member of a room that the bot is in. This can be the user ID of a user who has not added the bot as a friend or has blocked the bot.
public
# getGroupMemberIds( string $groupId , string $start = NULL )
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 bot as a friend or has blocked the bot. This feature is only available for LINE@ Approved accounts or official accounts.
public
# getRoomMemberIds( string $roomId , string $start = NULL )
Gets the user IDs of the members of a room that the bot is in. This includes the user IDs of users who have not added the bot as a friend or has blocked the bot. This feature is only available for LINE@ Approved accounts or official accounts.
public
# getAllGroupMemberIds( string $groupId )
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 bot as a friend or has blocked the bot. This method gets all of the members by calling getGroupMemberIds() continually using token This feature is only available for LINE@ Approved accounts or official accounts.

see

LINE\LINEBot::getGroupMemberIds()
public
# getAllRoomMemberIds( string $roomId )
Gets the user IDs of the members of a room that the bot is in. This includes the user IDs of users who have not added the bot as a friend or has blocked the bot. This method gets all of the members by calling getRoomMemberIds() continually using token This feature is only available for LINE@ Approved accounts or official accounts.

see

LINE\LINEBot::getRoomMemberIds()
public
# getGroupSummary( string $groupId )
Get group summary Gets the group ID, group name, and group icon URL of a group where the LINE Official Account is a member.
public
# getGroupMembersCount( string $groupId )
Gets the count of members in a group The number returned excludes the LINE Official Account.
public
# getRoomMembersCount( string $roomId )
Gets the count of members in a room The number returned excludes the LINE Official Account.
public
# createLinkToken( string $userId )
Issues a link token used for the account link feature.
public
# getRichMenu( string $richMenuId )
Gets a rich menu via a rich menu ID.
public
# createRichMenu( \RichMenuBuilder $richMenuBuilder )
Creates a rich menu. You must upload a rich menu image and link the rich menu to a user for the rich menu to be displayed.
public
# deleteRichMenu( string $richMenuId )
Deletes a rich menu.
public
# setDefaultRichMenuId( string $richMenuId )
Set the default rich menu.
public
# getDefaultRichMenuId( )
Get the default rich menu ID.
public
# cancelDefaultRichMenuId( )
Cancel the default rich menu.
public
# getRichMenuId( string $userId )
Gets the ID of the rich menu linked to a user.
public
# linkRichMenu( string $userId , string $richMenuId )
Links a rich menu to a user. Only one rich menu can be linked to a user at one time.
public
# bulkLinkRichMenu( string[] $userIds , string $richMenuId )
Links a rich menu to multiple users.
public
# unlinkRichMenu( string $userId )
Unlinks a rich menu from multiple user.
public
# bulkUnlinkRichMenu( string[] $userIds )
Unlinks rich menus from multiple users.
public
# downloadRichMenuImage( string $richMenuId )
Downloads an image associated with a rich menu.
public
# uploadRichMenuImage( string $richMenuId , string $imagePath , string $contentType )
Uploads and attaches an image to a rich menu. Notes: <ul><li>Images must have one of the following resolutions: 2500x1686 or 2500x843 pixels.</li> <li>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.</li></ul>
public
# getRichMenuList( )
Gets a list of all uploaded rich menus.
public
# getNumberOfSentReplyMessages( DateTime $datetime )
Get number of sent reply messages
public
# getNumberOfSentPushMessages( DateTime $datetime )
Get number of sent push messages
public
# getNumberOfSentMulticastMessages( DateTime $datetime )
Get number of sent multicast messages
public
# getNumberOfSentBroadcastMessages( DateTime $datetime )
Get number of sent broadcast messages
public
# getNumberOfMessageDeliveries( DateTime $datetime )
Get number of message deliveries
public
# getNumberOfFollowers( DateTime $datetime )
Get number of followers
public
# getFriendDemographics( )
Get friend demographics 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.
public
# getUserInteractionStatistics( string $requestId )
Get user interaction statistics Returns statistics about how users interact with broadcast messages sent from your LINE official account. Interactions are tracked for only 14 days after a message was sent. The statistics are no longer updated after 15 days.
public
# createChannelAccessToken( string $channelId )
Create channel access token Create a short-lived channel access token. Up to 30 tokens can be issued. If the maximum is exceeded, existing channel access tokens are revoked in the order of when they were first issued.
public
# revokeChannelAccessToken( string $channelAccessToken )
Revoke channel access token Revokes a channel access token.
public
# createChannelAccessToken21( string $jwt )
Create channel access token v2.1 You can issue up to 30 tokens. If you reach the maximum limit, additional requests of issuing channel access tokens are blocked.

see

public
# revokeChannelAccessToken21( string $channelId , string $channelSecret , string $channelAccessToken )
Revoke channel access token v2.1
public
# getChannelAccessToken21Keys( string $jwt )
Get all valid channel access token key IDs v2.1
public
# sendNarrowcast( LINE\LINEBot\MessageBuilder $messageBuilder , LINE\LINEBot\Narrowcast\Recipient\RecipientBuilder $recipientBuilder = NULL, LINE\LINEBot\Narrowcast\DemographicFilter\DemographicFilterBuilder $demographicFilterBuilder = NULL, int|null $max = NULL, string|null $retryKey = NULL, $upToRemainingQuota = false )
Send Narrowcast message.
public
# getNarrowcastProgress( string $requestId )
Get Narrowcast message sending progress.
public
# createAudienceGroupForUploadingUserIds( string $description , array $audiences = array ( ), bool $isIfaAudience = false, string|null $uploadDescription = NULL )
Create audience for uploading user IDs
public
# createAudienceGroupForUploadingUserIdsByFile( string $description , string $filePath , bool $isIfaAudience = false, string|null $uploadDescription = NULL )
Create audience for uploading user IDs (by file)
public
# updateAudienceGroupForUploadingUserIds( int $audienceGroupId , array $audiences , string|null $uploadDescription = NULL )
Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs
public
# updateAudienceGroupForUploadingUserIdsByFile( int $audienceGroupId , string $filePath , string|null $uploadDescription = NULL )
Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file)
public
# createAudienceGroupForClick( string $description , string $requestId , string|null $clickUrl = NULL )
Create audience for click-based retargeting
public
# createAudienceGroupForImpression( string $description , string $requestId )
Create audience for impression-based retargeting
public
# renameAudience( int $audienceGroupId , string $description )
Rename an audience
public
# deleteAudience( int $audienceGroupId )
Delete audience
public
# getAudience( int $audienceGroupId )
Get audience
public
# getAudiences( int $page , int $size = 20, string|null $description = NULL, string|null $status = NULL, bool|null $includesExternalPublicGroups = NULL, string|null $createRoute = NULL )
Get data for multiple audiences
public
# getAuthorityLevel( )
Get the authority level of the audience
public
# updateAuthorityLevel( string $authorityLevel )
Change the authority level of the audience
public
# getWebhookEndpointInfo( )
Get webhook endpoint information
public
# setWebhookEndpoint( string $endpoint )
Set webhook endpoint URL
public
# testWebhookEndpoint( string $endpoint )
Checks if the configured webhook endpoint can receive a test webhook event
Constants Summary
public string DEFAULT_ENDPOINT_BASE
# 'https://api.line.me'
public string DEFAULT_DATA_ENDPOINT_BASE
# 'https://api-data.line.me'