LINEBot
in package
A client class of LINE Messaging API.
Tags
Table of Contents
- DEFAULT_DATA_ENDPOINT_BASE = 'https://api-data.line.me'
- DEFAULT_ENDPOINT_BASE = 'https://api.line.me'
- $channelSecret : string
- $dataEndpointBase : string
- $endpointBase : string
- $httpClient : HTTPClient
- __construct() : mixed
- LINEBot constructor.
- activateAudience() : Response
- Activate the audience
- broadcast() : Response
- Sends push messages to multiple users at any time.
- bulkLinkRichMenu() : Response
- Links a rich menu to multiple users.
- bulkUnlinkRichMenu() : Response
- Unlinks rich menus from multiple users.
- cancelDefaultRichMenuId() : Response
- Cancel the default rich menu.
- createAudienceGroupForClick() : Response
- Create audience for click-based retargeting
- createAudienceGroupForImpression() : Response
- Create audience for impression-based retargeting
- createAudienceGroupForUploadingUserIds() : Response
- Create audience for uploading user IDs
- createAudienceGroupForUploadingUserIdsByFile() : Response
- Create audience for uploading user IDs (by file)
- createChannelAccessToken() : Response
- Create channel access token
- createChannelAccessToken21() : Response
- Create channel access token v2.1
- createLinkToken() : Response
- Issues a link token used for the account link feature.
- createRichMenu() : Response
- Creates a rich menu.
- createRichMenuAlias() : Response
- Create rich menu alias
- deleteAudience() : Response
- Delete audience
- deleteRichMenu() : Response
- Deletes a rich menu.
- deleteRichMenuAlias() : Response
- Delete rich menu alias
- downloadRichMenuImage() : Response
- Downloads an image associated with a rich menu.
- getAllFollowerIds() : array<string|int, mixed>
- Gets the list of User IDs of users who have added your LINE Official Account as a friend.
- getAllGroupMemberIds() : array<string|int, mixed>
- Gets the user IDs of the members of a group that the bot is in.
- getAllNameListOfUnitsUsedThisMonth() : array<string|int, mixed>
- Get the name list of units used this month for statistics aggregation.
- getAllRoomMemberIds() : array<string|int, mixed>
- Gets the user IDs of the members of a room that the bot is in.
- getAudience() : Response
- Get audience
- getAudiences() : Response
- Get data for multiple audiences
- getAuthorityLevel() : Response
- Get the authority level of the audience
- getBotInfo() : Response
- Get basic information about bot.
- getChannelAccessToken21Keys() : Response
- Get all valid channel access token key IDs v2.1
- getDefaultRichMenuId() : Response
- Get the default rich menu ID.
- getFollowerIds() : Response
- Gets the list of User IDs of users who have added your LINE Official Account as a friend.
- getFriendDemographics() : Response
- Get friend demographics
- getGroupMemberIds() : Response
- Gets the user IDs of the members of a group that the bot is in.
- getGroupMemberProfile() : Response
- Gets the user profile of a member of a group that the bot is in.
- getGroupMembersCount() : Response
- Gets the count of members in a group
- getGroupSummary() : Response
- Get group summary
- getMessageContent() : Response
- Gets message content which is associated with specified message ID.
- getNameListOfUnitsUsedThisMonth() : Response
- Get the name list of units used this month for statistics aggregation.
- getNarrowcastProgress() : Response
- Get Narrowcast message sending progress.
- getNumberOfFollowers() : Response
- Get number of followers
- getNumberOfLimitForAdditional() : Response
- Gets the target limit for additional messages in the current month.
- getNumberOfMessageDeliveries() : Response
- Get number of message deliveries
- getNumberOfSentBroadcastMessages() : Response
- Get number of sent broadcast messages
- getNumberOfSentMulticastMessages() : Response
- Get number of sent multicast messages
- getNumberOfSentPushMessages() : Response
- Get number of sent push messages
- getNumberOfSentReplyMessages() : Response
- Get number of sent reply messages
- getNumberOfSentThisMonth() : Response
- Gets the number of messages sent in the current month.
- getNumberOfUnitsUsedThisMonth() : Response
- Get the number of aggregation units used this month.
- getProfile() : Response
- Gets specified user's profile through API calling.
- getRichMenu() : Response
- Gets a rich menu via a rich menu ID.
- getRichMenuAlias() : Response
- Get rich menu alias information
- getRichMenuAliasList() : Response
- Get list of rich menu alias
- getRichMenuId() : Response
- Gets the ID of the rich menu linked to a user.
- getRichMenuList() : Response
- Gets a list of all uploaded rich menus.
- getRoomMemberIds() : Response
- Gets the user IDs of the members of a room that the bot is in.
- getRoomMemberProfile() : Response
- Gets the user profile of a member of a room that the bot is in.
- getRoomMembersCount() : Response
- Gets the count of members in a room
- getUserInteractionStatistics() : Response
- Get user interaction statistics
- getUserInteractionStatisticsPerUnit() : Response
- Get the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.
- getWebhookEndpointInfo() : Response
- Get webhook endpoint information
- leaveGroup() : Response
- Leaves from group.
- leaveRoom() : Response
- Leaves from room.
- linkRichMenu() : Response
- Links a rich menu to a user. Only one rich menu can be linked to a user at one time.
- multicast() : Response
- Sends arbitrary message to multi destinations.
- parseEventRequest() : mixed
- Parse event request to Event objects.
- pushMessage() : Response
- Sends arbitrary message to destination.
- renameAudience() : Response
- Rename an audience
- replyMessage() : Response
- Replies arbitrary message to destination which is associated with reply token.
- replyText() : Response
- Replies text message(s) to destination which is associated with reply token.
- revokeChannelAccessToken() : Response
- Revoke channel access token
- revokeChannelAccessToken21() : Response
- Revoke channel access token v2.1
- sendNarrowcast() : Response
- Send Narrowcast message.
- setDefaultRichMenuId() : Response
- Set the default rich menu.
- setWebhookEndpoint() : Response
- Set webhook endpoint URL
- testWebhookEndpoint() : Response
- Checks if the configured webhook endpoint can receive a test webhook event
- unlinkRichMenu() : Response
- Unlinks a rich menu from multiple user.
- updateAudienceGroupForUploadingUserIds() : Response
- Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs
- updateAudienceGroupForUploadingUserIdsByFile() : Response
- Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file)
- updateAuthorityLevel() : Response
- Change the authority level of the audience
- updateRichMenuAlias() : Response
- Update rich menu alias
- uploadRichMenuImage() : Response
- Uploads and attaches an image to a rich menu.
- validateSignature() : bool
- Validate request with signature.
Constants
DEFAULT_DATA_ENDPOINT_BASE
public
mixed
DEFAULT_DATA_ENDPOINT_BASE
= 'https://api-data.line.me'
DEFAULT_ENDPOINT_BASE
public
mixed
DEFAULT_ENDPOINT_BASE
= 'https://api.line.me'
Properties
$channelSecret
private
string
$channelSecret
$dataEndpointBase
private
string
$dataEndpointBase
$endpointBase
private
string
$endpointBase
$httpClient
private
HTTPClient
$httpClient
Methods
__construct()
LINEBot constructor.
public
__construct(HTTPClient $httpClient, array<string|int, mixed> $args) : mixed
Parameters
- $httpClient : HTTPClient
-
HTTP client instance to use API calling.
- $args : array<string|int, mixed>
-
Configurations.
Return values
mixed —activateAudience()
Activate the audience
public
activateAudience(int $audienceGroupId) : Response
Parameters
- $audienceGroupId : int
-
The audience ID.
Return values
Response —broadcast()
Sends push messages to multiple users at any time.
public
broadcast(MessageBuilder $messageBuilder[, bool $notificationDisabled = false ][, string|null $retryKey = null ]) : Response
LINE@ accounts cannot call this API endpoint. Please migrate it to a LINE official account.
Parameters
- $messageBuilder : MessageBuilder
-
Message builder to send.
- $notificationDisabled : bool = false
-
Don't send push notifications(=true) or send(=false)
- $retryKey : string|null = null
-
UUID(example: 123e4567-e89b-12d3-a456-426614174000) or Not needed retry(=null)
Return values
Response —bulkLinkRichMenu()
Links a rich menu to multiple users.
public
bulkLinkRichMenu(array<string|int, string> $userIds, string $richMenuId) : Response
Parameters
- $userIds : array<string|int, string>
-
Found in the source object of webhook event objects. Max: 150 user IDs.
- $richMenuId : string
-
ID of an uploaded rich menu
Return values
Response —bulkUnlinkRichMenu()
Unlinks rich menus from multiple users.
public
bulkUnlinkRichMenu(array<string|int, string> $userIds) : Response
Parameters
- $userIds : array<string|int, string>
-
Found in the source object of webhook event objects. Max: 150 user IDs.
Return values
Response —cancelDefaultRichMenuId()
Cancel the default rich menu.
public
cancelDefaultRichMenuId() : Response
Return values
Response —createAudienceGroupForClick()
Create audience for click-based retargeting
public
createAudienceGroupForClick(string $description, string $requestId[, string|null $clickUrl = null ]) : Response
Parameters
- $description : string
-
The audience's name. Max character limit: 120
- $requestId : string
-
The request ID of a broadcast or narrowcast message sent in the past 60 days.
- $clickUrl : string|null = null
-
The URL clicked by the user. Max character limit: 2,000
Return values
Response —createAudienceGroupForImpression()
Create audience for impression-based retargeting
public
createAudienceGroupForImpression(string $description, string $requestId) : Response
Parameters
- $description : string
-
The audience's name. Max character limit: 120
- $requestId : string
-
The request ID of a broadcast or narrowcast message sent in the past 60 days.
Return values
Response —createAudienceGroupForUploadingUserIds()
Create audience for uploading user IDs
public
createAudienceGroupForUploadingUserIds(string $description[, array<string|int, mixed> $audiences = [] ][, bool $isIfaAudience = false ][, string|null $uploadDescription = null ]) : Response
Parameters
- $description : string
-
The audience's name. Max character limit: 120
- $audiences : array<string|int, mixed> = []
-
An array of up to 10,000 user IDs or IFAs.
- $isIfaAudience : bool = false
-
If this is false (default), recipients are specified by user IDs.
- $uploadDescription : string|null = null
-
The description to register with the job.
Return values
Response —createAudienceGroupForUploadingUserIdsByFile()
Create audience for uploading user IDs (by file)
public
createAudienceGroupForUploadingUserIdsByFile(string $description, string $filePath[, bool $isIfaAudience = false ][, string|null $uploadDescription = null ]) : Response
Parameters
- $description : string
-
The audience's name. Max character limit: 120
- $filePath : string
-
A text file path with one user ID or IFA entered per line. Max number: 1,500,000
- $isIfaAudience : bool = false
-
If this is false (default), recipients are specified by user IDs.
- $uploadDescription : string|null = null
-
The description to register with the job.
Return values
Response —createChannelAccessToken()
Create channel access token
public
createChannelAccessToken(string $channelId) : Response
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.
Parameters
- $channelId : string
Return values
Response —createChannelAccessToken21()
Create channel access token v2.1
public
createChannelAccessToken21(string $jwt) : Response
You can issue up to 30 tokens. If you reach the maximum limit, additional requests of issuing channel access tokens are blocked.
Parameters
- $jwt : string
Tags
Return values
Response —createLinkToken()
Issues a link token used for the account link feature.
public
createLinkToken(string $userId) : Response
Parameters
- $userId : string
-
User ID for the LINE account to be linked.
Return values
Response —createRichMenu()
Creates a rich menu.
public
createRichMenu(RichMenuBuilder $richMenuBuilder) : Response
You must upload a rich menu image and link the rich menu to a user for the rich menu to be displayed.
Parameters
- $richMenuBuilder : RichMenuBuilder
Return values
Response —createRichMenuAlias()
Create rich menu alias
public
createRichMenuAlias(string $richMenuAliasId, string $richMenuId) : Response
Parameters
- $richMenuAliasId : string
-
Rich menu alias ID, which can be any ID, unique for each channel.
- $richMenuId : string
-
The rich menu ID to be associated with the rich menu alias.
Return values
Response —deleteAudience()
Delete audience
public
deleteAudience(int $audienceGroupId) : Response
Parameters
- $audienceGroupId : int
-
The audience ID.
Return values
Response —deleteRichMenu()
Deletes a rich menu.
public
deleteRichMenu(string $richMenuId) : Response
Parameters
- $richMenuId : string
-
ID of an uploaded rich menu
Return values
Response —deleteRichMenuAlias()
Delete rich menu alias
public
deleteRichMenuAlias(string $richMenuAliasId) : Response
Parameters
- $richMenuAliasId : string
-
The rich menu alias ID whose information you want to obtain.
Return values
Response —downloadRichMenuImage()
Downloads an image associated with a rich menu.
public
downloadRichMenuImage(string $richMenuId) : Response
Parameters
- $richMenuId : string
-
ID of an uploaded rich menu
Return values
Response —getAllFollowerIds()
Gets the list of User IDs of users who have added your LINE Official Account as a friend.
public
getAllFollowerIds() : array<string|int, mixed>
These users' IDs won't be included in the obtained list of user IDs:
- Users who blocked the target LINE Official Account after adding it as a friend.
- Users who haven't consented to their profile information being obtained.
This method gets all of followers by calling getFollowerIds() continually using token
This feature is only available for LINE@ Approved accounts or official accounts.
Tags
Return values
array<string|int, mixed> —userIds
getAllGroupMemberIds()
Gets the user IDs of the members of a group that the bot is in.
public
getAllGroupMemberIds(string $groupId) : array<string|int, mixed>
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.
Parameters
- $groupId : string
-
Identifier of the group
Tags
Return values
array<string|int, mixed> —memberIds
getAllNameListOfUnitsUsedThisMonth()
Get the name list of units used this month for statistics aggregation.
public
getAllNameListOfUnitsUsedThisMonth() : array<string|int, mixed>
This method gets all of the names by calling getNameListOfUnitsUsedThisMonth() continually using token
Return values
array<string|int, mixed> —getAllRoomMemberIds()
Gets the user IDs of the members of a room that the bot is in.
public
getAllRoomMemberIds(string $roomId) : array<string|int, mixed>
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.
Parameters
- $roomId : string
-
Identifier of the room
Tags
Return values
array<string|int, mixed> —memberIds
getAudience()
Get audience
public
getAudience(int $audienceGroupId) : Response
Parameters
- $audienceGroupId : int
-
The audience ID.
Return values
Response —getAudiences()
Get data for multiple audiences
public
getAudiences(int $page[, int $size = 20 ][, string|null $description = null ][, string|null $status = null ][, bool|null $includesExternalPublicGroups = null ][, string|null $createRoute = null ]) : Response
Parameters
- $page : int
-
The page to return when getting (paginated) results. Must be 1 or higher.
- $size : int = 20
-
The number of audiences per page. Max: 40
- $description : string|null = null
-
You can search for partial matches.
- $status : string|null = null
-
One of: IN_PROGRESS, READY, FAILED, EXPIRED
- $includesExternalPublicGroups : bool|null = null
- $createRoute : string|null = null
-
How the audience was created. One of: OA_MANAGER, MESSAGING_API
Return values
Response —getAuthorityLevel()
Get the authority level of the audience
public
getAuthorityLevel() : Response
Return values
Response —getBotInfo()
Get basic information about bot.
public
getBotInfo() : Response
Return values
Response —getChannelAccessToken21Keys()
Get all valid channel access token key IDs v2.1
public
getChannelAccessToken21Keys(string $jwt) : Response
Parameters
- $jwt : string
Return values
Response —getDefaultRichMenuId()
Get the default rich menu ID.
public
getDefaultRichMenuId() : Response
Return values
Response —getFollowerIds()
Gets the list of User IDs of users who have added your LINE Official Account as a friend.
public
getFollowerIds([string|null $start = null ]) : Response
These users' IDs won't be included in the obtained list of user IDs:
- Users who blocked the target LINE Official Account after adding it as a friend.
- Users who haven't consented to their profile information being obtained.
This feature is only available for LINE@ Approved accounts or official accounts.
Parameters
- $start : string|null = null
-
continuationToken
Return values
Response —getFriendDemographics()
Get friend demographics
public
getFriendDemographics() : Response
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.
Return values
Response —getGroupMemberIds()
Gets the user IDs of the members of a group that the bot is in.
public
getGroupMemberIds(string $groupId[, string|null $start = null ]) : Response
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.
Parameters
- $groupId : string
-
Identifier of the group
- $start : string|null = null
-
continuationToken
Return values
Response —getGroupMemberProfile()
Gets the user profile of a member of a group that the bot is in.
public
getGroupMemberProfile(string $groupId, string $userId) : Response
This can be the user ID of a user who has not added the bot as a friend or has blocked the bot.
Parameters
- $groupId : string
-
Identifier of the group
- $userId : string
-
Identifier of the user
Return values
Response —getGroupMembersCount()
Gets the count of members in a group
public
getGroupMembersCount(string $groupId) : Response
The number returned excludes the LINE Official Account.
Parameters
- $groupId : string
-
Group ID
Return values
Response —getGroupSummary()
Get group summary
public
getGroupSummary(string $groupId) : Response
Gets the group ID, group name, and group icon URL of a group where the LINE Official Account is a member.
Parameters
- $groupId : string
-
Group ID
Return values
Response —getMessageContent()
Gets message content which is associated with specified message ID.
public
getMessageContent(string $messageId) : Response
Parameters
- $messageId : string
-
The message ID to retrieve content.
Return values
Response —getNameListOfUnitsUsedThisMonth()
Get the name list of units used this month for statistics aggregation.
public
getNameListOfUnitsUsedThisMonth([string|null $limit = null ][, int|null $start = null ]) : Response
Parameters
- $limit : string|null = null
- $start : int|null = null
Return values
Response —getNarrowcastProgress()
Get Narrowcast message sending progress.
public
getNarrowcastProgress(string $requestId) : Response
Parameters
- $requestId : string
Return values
Response —getNumberOfFollowers()
Get number of followers
public
getNumberOfFollowers(DateTime $datetime) : Response
Parameters
- $datetime : DateTime
-
Date for which to retrieve the number of followers.
Return values
Response —getNumberOfLimitForAdditional()
Gets the target limit for additional messages in the current month.
public
getNumberOfLimitForAdditional() : Response
Return values
Response —getNumberOfMessageDeliveries()
Get number of message deliveries
public
getNumberOfMessageDeliveries(DateTime $datetime) : Response
Parameters
- $datetime : DateTime
-
Date for which to retrieve number of sent messages.
Return values
Response —getNumberOfSentBroadcastMessages()
Get number of sent broadcast messages
public
getNumberOfSentBroadcastMessages(DateTime $datetime) : Response
Parameters
- $datetime : DateTime
-
Date the messages were sent.
Return values
Response —getNumberOfSentMulticastMessages()
Get number of sent multicast messages
public
getNumberOfSentMulticastMessages(DateTime $datetime) : Response
Parameters
- $datetime : DateTime
-
Date the messages were sent.
Return values
Response —getNumberOfSentPushMessages()
Get number of sent push messages
public
getNumberOfSentPushMessages(DateTime $datetime) : Response
Parameters
- $datetime : DateTime
-
Date the messages were sent.
Return values
Response —getNumberOfSentReplyMessages()
Get number of sent reply messages
public
getNumberOfSentReplyMessages(DateTime $datetime) : Response
Parameters
- $datetime : DateTime
-
Date the messages were sent.
Return values
Response —getNumberOfSentThisMonth()
Gets the number of messages sent in the current month.
public
getNumberOfSentThisMonth() : Response
Return values
Response —getNumberOfUnitsUsedThisMonth()
Get the number of aggregation units used this month.
public
getNumberOfUnitsUsedThisMonth() : Response
Return values
Response —getProfile()
Gets specified user's profile through API calling.
public
getProfile(string $userId) : Response
Parameters
- $userId : string
-
The user ID to retrieve profile.
Return values
Response —getRichMenu()
Gets a rich menu via a rich menu ID.
public
getRichMenu(string $richMenuId) : Response
Parameters
- $richMenuId : string
-
ID of an uploaded rich menu
Return values
Response —getRichMenuAlias()
Get rich menu alias information
public
getRichMenuAlias(string $richMenuAliasId) : Response
Parameters
- $richMenuAliasId : string
-
The rich menu alias ID whose information you want to obtain.
Return values
Response —getRichMenuAliasList()
Get list of rich menu alias
public
getRichMenuAliasList() : Response
Return values
Response —getRichMenuId()
Gets the ID of the rich menu linked to a user.
public
getRichMenuId(string $userId) : Response
Parameters
- $userId : string
-
User ID. Found in the source object of webhook event objects.
Return values
Response —getRichMenuList()
Gets a list of all uploaded rich menus.
public
getRichMenuList() : Response
Return values
Response —getRoomMemberIds()
Gets the user IDs of the members of a room that the bot is in.
public
getRoomMemberIds(string $roomId[, string|null $start = null ]) : Response
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.
Parameters
- $roomId : string
-
Identifier of the room
- $start : string|null = null
-
continuationToken
Return values
Response —getRoomMemberProfile()
Gets the user profile of a member of a room that the bot is in.
public
getRoomMemberProfile(string $roomId, string $userId) : Response
This can be the user ID of a user who has not added the bot as a friend or has blocked the bot.
Parameters
- $roomId : string
-
Identifier of the room
- $userId : string
-
Identifier of the user
Return values
Response —getRoomMembersCount()
Gets the count of members in a room
public
getRoomMembersCount(string $roomId) : Response
The number returned excludes the LINE Official Account.
Parameters
- $roomId : string
-
Room ID
Return values
Response —getUserInteractionStatistics()
Get user interaction statistics
public
getUserInteractionStatistics(string $requestId) : Response
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.
Parameters
- $requestId : string
-
Request ID of broadcast message.
Return values
Response —getUserInteractionStatisticsPerUnit()
Get the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account.
public
getUserInteractionStatisticsPerUnit(string $customAggregationUnit, string $from, string $to) : Response
Parameters
- $customAggregationUnit : string
-
Name of aggregation unit
- $from : string
-
Start date of aggregation period
- $to : string
-
End date of aggregation period
Return values
Response —getWebhookEndpointInfo()
Get webhook endpoint information
public
getWebhookEndpointInfo() : Response
Return values
Response —leaveGroup()
Leaves from group.
public
leaveGroup(string $groupId) : Response
Parameters
- $groupId : string
-
Identifier of group to leave.
Return values
Response —leaveRoom()
Leaves from room.
public
leaveRoom(string $roomId) : Response
Parameters
- $roomId : string
-
Identifier of room to leave.
Return values
Response —linkRichMenu()
Links a rich menu to a user. Only one rich menu can be linked to a user at one time.
public
linkRichMenu(string $userId, string $richMenuId) : Response
Parameters
- $userId : string
-
User ID. Found in the source object of webhook event objects.
- $richMenuId : string
-
ID of an uploaded rich menu
Return values
Response —multicast()
Sends arbitrary message to multi destinations.
public
multicast(array<string|int, mixed> $tos, MessageBuilder $messageBuilder[, bool $notificationDisabled = false ][, string|null $retryKey = null ][, array<string|int, mixed> $customAggregationUnits = array() ]) : Response
Parameters
- $tos : array<string|int, mixed>
-
Identifiers of destination.
- $messageBuilder : MessageBuilder
-
Message builder to send.
- $notificationDisabled : bool = false
-
Don't send push notifications(=true) or send(=false)
- $retryKey : string|null = null
-
UUID(example: 123e4567-e89b-12d3-a456-426614174000) or Not needed retry(=null)
- $customAggregationUnits : array<string|int, mixed> = array()
-
Name of aggregation unit.
Return values
Response —parseEventRequest()
Parse event request to Event objects.
public
parseEventRequest(string $body, string $signature[, bool $eventOnly = true ]) : mixed
Parameters
- $body : string
-
Request body.
- $signature : string
-
Signature of request.
- $eventOnly : bool = true
-
if this flag on, get events only.
Tags
Return values
mixed —pushMessage()
Sends arbitrary message to destination.
public
pushMessage(string $to, MessageBuilder $messageBuilder[, bool $notificationDisabled = false ][, string|null $retryKey = null ][, array<string|int, mixed> $customAggregationUnits = array() ]) : Response
Parameters
- $to : string
-
Identifier of destination.
- $messageBuilder : MessageBuilder
-
Message builder to send.
- $notificationDisabled : bool = false
-
Don't send push notifications(=true) or send(=false)
- $retryKey : string|null = null
-
UUID(example: 123e4567-e89b-12d3-a456-426614174000) or Not needed retry(=null)
- $customAggregationUnits : array<string|int, mixed> = array()
-
Name of aggregation unit.
Return values
Response —renameAudience()
Rename an audience
public
renameAudience(int $audienceGroupId, string $description) : Response
Parameters
- $audienceGroupId : int
-
The audience ID.
- $description : string
-
The audience's name. Max character limit: 120
Return values
Response —replyMessage()
Replies arbitrary message to destination which is associated with reply token.
public
replyMessage(string $replyToken, MessageBuilder $messageBuilder) : Response
Parameters
- $replyToken : string
-
Identifier of destination.
- $messageBuilder : MessageBuilder
-
Message builder to send.
Return values
Response —replyText()
Replies text message(s) to destination which is associated with reply token.
public
replyText(string $replyToken, string $text[, array<string|int, string>|null $extraTexts = null ]) : Response
This method receives variable texts. It can send text(s) message as bulk.
Exact signature of this method is replyText(string $replyToken, string $text, string[] $extraTexts)
.
Means, this method can also receive multiple texts like so;
$bot->replyText('reply-text', 'text', 'extra text1', 'extra text2', ...)
Parameters
- $replyToken : string
-
Identifier of destination.
- $text : string
-
Text of message.
- $extraTexts : array<string|int, string>|null = null
-
Extra text of message.
Tags
Return values
Response —revokeChannelAccessToken()
Revoke channel access token
public
revokeChannelAccessToken(string $channelAccessToken) : Response
Revokes a channel access token.
Parameters
- $channelAccessToken : string
Return values
Response —revokeChannelAccessToken21()
Revoke channel access token v2.1
public
revokeChannelAccessToken21(string $channelId, string $channelSecret, string $channelAccessToken) : Response
Parameters
- $channelId : string
- $channelSecret : string
- $channelAccessToken : string
Return values
Response —sendNarrowcast()
Send Narrowcast message.
public
sendNarrowcast(MessageBuilder $messageBuilder[, RecipientBuilder|null $recipientBuilder = null ][, DemographicFilterBuilder|null $demographicFilterBuilder = null ][, int|null $max = null ][, string|null $retryKey = null ][, mixed $upToRemainingQuota = false ]) : Response
Parameters
- $messageBuilder : MessageBuilder
- $recipientBuilder : RecipientBuilder|null = null
- $demographicFilterBuilder : DemographicFilterBuilder|null = null
- $max : int|null = null
- $retryKey : string|null = null
-
UUID(example: 123e4567-e89b-12d3-a456-426614174000) or Not needed retry(=null)
- $upToRemainingQuota : mixed = false
Return values
Response —setDefaultRichMenuId()
Set the default rich menu.
public
setDefaultRichMenuId(string $richMenuId) : Response
Parameters
- $richMenuId : string
-
ID of an uploaded rich menu
Return values
Response —setWebhookEndpoint()
Set webhook endpoint URL
public
setWebhookEndpoint(string $endpoint) : Response
Parameters
- $endpoint : string
Return values
Response —testWebhookEndpoint()
Checks if the configured webhook endpoint can receive a test webhook event
public
testWebhookEndpoint(string $endpoint) : Response
Parameters
- $endpoint : string
Return values
Response —unlinkRichMenu()
Unlinks a rich menu from multiple user.
public
unlinkRichMenu(string $userId) : Response
Parameters
- $userId : string
-
User ID. Found in the source object of webhook event objects.
Return values
Response —updateAudienceGroupForUploadingUserIds()
Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs
public
updateAudienceGroupForUploadingUserIds(int $audienceGroupId, array<string|int, mixed> $audiences[, string|null $uploadDescription = null ]) : Response
Parameters
- $audienceGroupId : int
-
The audience ID.
- $audiences : array<string|int, mixed>
-
An array of up to 10,000 user IDs or IFAs.
- $uploadDescription : string|null = null
-
The description to register with the job.
Return values
Response —updateAudienceGroupForUploadingUserIdsByFile()
Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file)
public
updateAudienceGroupForUploadingUserIdsByFile(int $audienceGroupId, string $filePath[, string|null $uploadDescription = null ]) : Response
Parameters
- $audienceGroupId : int
-
The audience ID.
- $filePath : string
-
A text file path with one user ID or IFA entered per line. Max number: 1,500,000
- $uploadDescription : string|null = null
-
The description to register with the job.
Return values
Response —updateAuthorityLevel()
Change the authority level of the audience
public
updateAuthorityLevel(string $authorityLevel) : Response
Parameters
- $authorityLevel : string
-
One of: PUBLIC, PRIVATE
Return values
Response —updateRichMenuAlias()
Update rich menu alias
public
updateRichMenuAlias(string $richMenuAliasId, string $richMenuId) : Response
Parameters
- $richMenuAliasId : string
-
The rich menu alias ID whose information you want to obtain.
- $richMenuId : string
-
The rich menu ID to be associated with the rich menu alias.
Return values
Response —uploadRichMenuImage()
Uploads and attaches an image to a rich menu.
public
uploadRichMenuImage(string $richMenuId, string $imagePath, string $contentType) : Response
Notes:
- Images must have one of the following resolutions: 2500x1686 or 2500x843 pixels.
- 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.
Parameters
- $richMenuId : string
-
ID of an uploaded rich menu
- $imagePath : string
-
Path to the image
- $contentType : string
-
image/jpeg or image/png
Return values
Response —validateSignature()
Validate request with signature.
public
validateSignature(string $body, string $signature) : bool
Parameters
- $body : string
-
Request body.
- $signature : string
-
Signature of request.
Tags
Return values
bool —Request is valid or not.