LINEBot

A client class of LINE Messaging API.
Methods Summary
public
# __construct( LINE\LINEBot\HTTPClient $httpClient , array $args )
LINEBot constructor.
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 )
Sends arbitrary message to destination.
public
# multicast( array $tos , LINE\LINEBot\MessageBuilder $messageBuilder , bool $notificationDisabled = false )
Sends arbitrary message to multi destinations.
public
# broadcast( LINE\LINEBot\MessageBuilder $messageBuilder , bool $notificationDisabled = false )
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
# 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
# sendNarrowcast( LINE\LINEBot\MessageBuilder $messageBuilder , LINE\LINEBot\Narrowcast\Recipient\RecipientBuilder $recipientBuilder = NULL, LINE\LINEBot\Narrowcast\DemographicFilter\DemographicFilterBuilder $demographicFilterBuilder = NULL, int|null $limit = NULL )
Send Narrowcast message.
public
# getNarrowcastProgress( string $requestId )
Get Narrowcast message sending progress.
Constants Summary
public string DEFAULT_ENDPOINT_BASE
# 'https://api.line.me'
public string DEFAULT_DATA_ENDPOINT_BASE
# 'https://api-data.line.me'