Interface LineMessagingClient

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> broadcast​(com.linecorp.bot.model.Broadcast broadcast)
      Sends push messages to multiple users at any time.
      static LineMessagingClientBuilder builder​(ChannelTokenSupplier channelTokenSupplier)  
      static LineMessagingClientBuilder builder​(java.lang.String channelToken)  
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> cancelDefaultRichMenu()
      Cancel default rich menu.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenu.RichMenuIdResponse> createRichMenu​(com.linecorp.bot.model.richmenu.RichMenu richMenu)
      Creates a rich menu.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> createRichMenuAlias​(com.linecorp.bot.model.richmenualias.CreateRichMenuAliasRequest request)
      Create a rich menu alias.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> deleteRichMenu​(java.lang.String richMenuId)
      Deletes a rich menu.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> deleteRichMenuAlias​(java.lang.String richMenuAliasId)
      Delete specified rich menu alias.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetAggregationUnitNameListResponse> getAggregationUnitNameList​(java.lang.String limit, java.lang.String start)
      Get name list of units used this month.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetAggregationUnitUsageResponse> getAggregationUnitUsage()
      Get number of units used this month.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotInfoResponse> getBotInfo()
      Gets a bot's basic information.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenu.RichMenuIdResponse> getDefaultRichMenuId()
      Get default rich menu ID.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetFollowersResponse> getFollowers​(com.linecorp.bot.model.request.GetFollowersRequest request)
      Get a list of users who added your LINE Official Account as a friend.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.demographics.GetFriendsDemographicsResponse> getFriendsDemographics()
      Retrieves the demographic attributes for a bot's friends.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.group.GroupMemberCountResponse> getGroupMemberCount​(java.lang.String groupId)
      Get members in group count.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.UserProfileResponse> getGroupMemberProfile​(java.lang.String groupId, java.lang.String userId)
      Get group member profile.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.MembersIdsResponse> getGroupMembersIds​(java.lang.String groupId, java.lang.String start)
      Get (a part of) group member list.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.group.GroupSummaryResponse> getGroupSummary​(java.lang.String groupId)
      Get group summary.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetMessageEventResponse> getMessageEvent​(java.lang.String requestId)
      Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.MessageQuotaResponse> getMessageQuota()
      Gets the target limit for additional messages in the current month.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.QuotaConsumptionResponse> getMessageQuotaConsumption()
      Gets the number of messages sent in the current month.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NarrowcastProgressResponse> getNarrowcastProgress​(java.lang.String requestId)
      Gets the status of a narrowcast message.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetNumberOfFollowersResponse> getNumberOfFollowers​(java.lang.String date)
      Gets the number of users who have added the bot on or before a specified date.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetNumberOfMessageDeliveriesResponse> getNumberOfMessageDeliveries​(java.lang.String date)
      Get number of message deliveries.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentBroadcastMessages​(java.lang.String date)
      Gets the number of messages sent with the "/bot/message/broadcast" endpoint.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentMulticastMessages​(java.lang.String date)
      Gets the number of messages sent with the /bot/message/multicast endpoint.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentPushMessages​(java.lang.String date)
      Gets the number of messages sent with the /bot/message/push endpoint.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentReplyMessages​(java.lang.String date)
      Gets the number of messages sent with the /bot/message/reply endpoint.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.UserProfileResponse> getProfile​(java.lang.String userId)
      Get user profile information.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenu.RichMenuResponse> getRichMenu​(java.lang.String richMenuId)
      Get a rich menu.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenualias.RichMenuAliasResponse> getRichMenuAlias​(java.lang.String richMenuAliasId)
      Get specified rich menu alias.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenualias.RichMenuAliasListResponse> getRichMenuAliasList()
      Get rich menu alias list.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenu.RichMenuIdResponse> getRichMenuIdOfUser​(java.lang.String userId)
      Get rich menu ID of user.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenu.RichMenuListResponse> getRichMenuList()
      Gets a list of all uploaded rich menus.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.room.RoomMemberCountResponse> getRoomMemberCount​(java.lang.String roomId)
      Get members in room count.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.UserProfileResponse> getRoomMemberProfile​(java.lang.String roomId, java.lang.String userId)
      Get room member profile.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.MembersIdsResponse> getRoomMembersIds​(java.lang.String roomId, java.lang.String start)
      Get (a part of) room member list.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetStatisticsPerUnitResponse> getStatisticsPerUnit​(java.lang.String customAggregationUnit, java.lang.String from, java.lang.String to)
      Get statistics per aggregation unit.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetWebhookEndpointResponse> getWebhookEndpoint()
      Gets webhook endpoint information.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.IssueLinkTokenResponse> issueLinkToken​(java.lang.String userId)
      Issues a link token used for the account link feature.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> leaveGroup​(java.lang.String groupId)
      Leave a group.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> leaveRoom​(java.lang.String roomId)
      Leave a room.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> linkRichMenuIdToUser​(java.lang.String userId, java.lang.String richMenuId)
      Link rich menu to user.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> linkRichMenuIdToUsers​(java.util.List<java.lang.String> userIds, java.lang.String richMenuId)
      Link rich menu to users.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> multicast​(com.linecorp.bot.model.Multicast multicast)
      Send messages to multiple users at any time.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> narrowcast​(com.linecorp.bot.model.Narrowcast broadcast)
      Sends a push message to multiple users.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> pushMessage​(com.linecorp.bot.model.PushMessage pushMessage)
      Send messages to users when you want to.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> replyMessage​(com.linecorp.bot.model.ReplyMessage replyMessage)
      Reply to messages from users.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> setDefaultRichMenu​(java.lang.String richMenuId)
      Set default rich menu.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.SetWebhookEndpointResponse> setWebhookEndpoint​(com.linecorp.bot.model.request.SetWebhookEndpointRequest request)
      Sets webhook endpoint URL.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.TestWebhookEndpointResponse> testWebhookEndpoint​(com.linecorp.bot.model.request.TestWebhookEndpointRequest request)
      Tests webhook endpoint.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> unlinkRichMenuIdFromUser​(java.lang.String userId)
      Unlink rich menu from user.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> unlinkRichMenuIdFromUsers​(java.util.List<java.lang.String> userIds)
      Unlink rich menu from users.
      java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> updateRichMenuAlias​(java.lang.String richMenuAliasId, com.linecorp.bot.model.richmenualias.UpdateRichMenuAliasRequest request)
      Update the rich menu Id which associated with the rich menu alias.
    • Method Detail

      • replyMessage

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> replyMessage​(com.linecorp.bot.model.ReplyMessage replyMessage)
        Reply to messages from users.

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

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

        See Also:
        pushMessage(PushMessage), //developers.line.me/en/reference/messaging-api/#send-reply-message
      • multicast

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> multicast​(com.linecorp.bot.model.Multicast multicast)
        Send messages to multiple users at any time. IDs of groups or rooms cannot be used.

        INFO: Only available for plans which support push messages. Messages cannot be sent to groups or rooms.

        INFO: Use IDs returned via the webhook event of source users. IDs of groups or rooms cannot be used. Do not use the LINE ID found on the LINE app.

        See Also:
        pushMessage(PushMessage), //developers.line.me/en/reference/messaging-api/#send-multicast-messages
      • broadcast

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> broadcast​(com.linecorp.bot.model.Broadcast broadcast)
        Sends push messages to multiple users at any time. Note: LINE@ accounts cannot call this API endpoint. Please migrate it to a LINE official account. For more information, see Migration of LINE@ accounts.
      • narrowcast

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> narrowcast​(com.linecorp.bot.model.Narrowcast broadcast)
        Sends a push message to multiple users. You can specify recipients using attributes (such as age, gender, OS, and region) or by retargeting (audiences). Messages cannot be sent to groups or rooms.

        Note: LINE-@ accounts cannot call this API endpoint. Please migrate it to a LINE official account. For more information, see Migration of LINE@ accounts.

      • getNarrowcastProgress

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NarrowcastProgressResponse> getNarrowcastProgress​(java.lang.String requestId)
        Gets the status of a narrowcast message.
      • getMessageQuota

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.MessageQuotaResponse> getMessageQuota()
        Gets the target limit for additional messages in the current month. The number of messages retrieved by this operation includes the number of messages sent from LINE Official Account Manager. Set a target limit with LINE Official Account Manager. For the procedures, refer to the LINE Official Account Manager manual. Note: LINE@ accounts cannot call this API endpoint.
      • getMessageQuotaConsumption

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.QuotaConsumptionResponse> getMessageQuotaConsumption()
        Gets the number of messages sent in the current month. The number of messages retrieved by this operation includes the number of messages sent from LINE Official Account Manager. The number of messages retrieved by this operation is approximate. To get the correct number of sent messages, use LINE Official Account Manager or execute API operations for getting the number of sent messages. Note: LINE@ accounts cannot call this API endpoint.
      • getNumberOfSentReplyMessages

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentReplyMessages​(java.lang.String date)
        Gets the number of messages sent with the /bot/message/reply endpoint. Note that the number of messages retrieved by this operation does not include the number of messages sent from LINE@ Manager.
        Parameters:
        date - Date the messages were sent. The format should be yyyyMMdd (for Example: "20191231") and the timezone should be UTC+9.
      • getNumberOfSentPushMessages

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentPushMessages​(java.lang.String date)
        Gets the number of messages sent with the /bot/message/push endpoint. Note that the number of messages retrieved by this operation does not include the number of messages sent from LINE@ Manager.
        Parameters:
        date - Date the messages were sent. The format should be yyyyMMdd (for Example: "20191231") and the timezone should be UTC+9.
      • getNumberOfSentMulticastMessages

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentMulticastMessages​(java.lang.String date)
        Gets the number of messages sent with the /bot/message/multicast endpoint. The number of messages retrieved by this operation does not include the number of messages sent from LINE@ Manager.
        Parameters:
        date - Date the messages were sent. The format should be yyyyMMdd (for Example: "20191231") and the timezone should be UTC+9.
      • getNumberOfSentBroadcastMessages

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.NumberOfMessagesResponse> getNumberOfSentBroadcastMessages​(java.lang.String date)
        Gets the number of messages sent with the "/bot/message/broadcast" endpoint. The number of messages retrieved by this operation does not include the number of messages sent from LINE Official Account Manager. Note: LINE@ accounts cannot call this API endpoint. Please migrate it to a LINE official account. For more information, see Migration of LINE@ accounts.
        Parameters:
        date - Date the messages were sent. The format should be yyyyMMdd (for Example: "20191231") and the timezone should be UTC+9.
      • getGroupMemberProfile

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.UserProfileResponse> getGroupMemberProfile​(java.lang.String groupId,
                                                                                                                         java.lang.String userId)
        Get group member profile.
        Parameters:
        groupId - Identifier of the group. Can be get by GroupSource.getGroupId().
        userId - Identifier of the user.
        See Also:
        //developers.line.me/en/reference/messaging-api/#get-group-member-profile
      • getRoomMemberProfile

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.UserProfileResponse> getRoomMemberProfile​(java.lang.String roomId,
                                                                                                                        java.lang.String userId)
        Get room member profile.
        Parameters:
        roomId - Identifier of the group. Can be get by RoomSource.getRoomId().
        userId - Identifier of the user.
        See Also:
        //developers.line.me/en/reference/messaging-api/#get-room-member-profile
      • getGroupMembersIds

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.MembersIdsResponse> getGroupMembersIds​(java.lang.String groupId,
                                                                                                                     java.lang.String start)
        Get (a part of) group member list.
        Parameters:
        start - nullable continuationToken which can be get MembersIdsResponse.getNext()
        See Also:
        //developers.line.me/en/reference/messaging-api/#get-group-member-user-ids, MembersIdsResponse.getNext()
      • getRoomMembersIds

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.profile.MembersIdsResponse> getRoomMembersIds​(java.lang.String roomId,
                                                                                                                    java.lang.String start)
        Get (a part of) room member list.
        Parameters:
        start - nullable continuationToken which can be get MembersIdsResponse.getNext()
        See Also:
        //developers.line.me/en/reference/messaging-api/#get-room-member-user-ids, MembersIdsResponse.getNext()
      • createRichMenu

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.richmenu.RichMenuIdResponse> createRichMenu​(com.linecorp.bot.model.richmenu.RichMenu richMenu)
        Creates a rich menu.

        Note: You must upload a rich menu image and link the rich menu to a user for the rich menu to be displayed. You can create up to 10 rich menus for one bot.

        See Also:
        //developers.line.me/en/docs/messaging-api/reference/#create-rich-menu
      • linkRichMenuIdToUsers

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> linkRichMenuIdToUsers​(java.util.List<java.lang.String> userIds,
                                                                                                                     java.lang.String richMenuId)
        Link rich menu to users.
        See Also:
        Link rich menu to multiple users
      • unlinkRichMenuIdFromUsers

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> unlinkRichMenuIdFromUsers​(java.util.List<java.lang.String> userIds)
        Unlink rich menu from users.
        See Also:
        Unlink rich menu to multiple users
      • updateRichMenuAlias

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotApiResponse> updateRichMenuAlias​(java.lang.String richMenuAliasId,
                                                                                                                   com.linecorp.bot.model.richmenualias.UpdateRichMenuAliasRequest request)
        Update the rich menu Id which associated with the rich menu alias.
        See Also:
        //developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias
      • issueLinkToken

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.IssueLinkTokenResponse> issueLinkToken​(java.lang.String userId)
        Issues a link token used for the account link feature.
        See Also:
        Issue link token
      • getNumberOfMessageDeliveries

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetNumberOfMessageDeliveriesResponse> getNumberOfMessageDeliveries​(java.lang.String date)
        Get number of message deliveries.
        See Also:
        LineMessagingService.getNumberOfMessageDeliveries(String)
      • getNumberOfFollowers

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetNumberOfFollowersResponse> getNumberOfFollowers​(java.lang.String date)
        Gets the number of users who have added the bot on or before a specified date.
      • getFollowers

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetFollowersResponse> getFollowers​(com.linecorp.bot.model.request.GetFollowersRequest request)
        Get a list of users who added your LINE Official Account as a friend.
      • getMessageEvent

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetMessageEventResponse> getMessageEvent​(java.lang.String requestId)
        Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account.

        You can get statistics per message or per bubble.

        Parameters:
        requestId - Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. Find it in the response headers.
      • getFriendsDemographics

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.demographics.GetFriendsDemographicsResponse> getFriendsDemographics()
        Retrieves the demographic attributes for a bot's friends.
        See Also:
        Get friends demographics
      • getBotInfo

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.BotInfoResponse> getBotInfo()
        Gets a bot's basic information.
        See Also:
        Get bot info
      • getWebhookEndpoint

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetWebhookEndpointResponse> getWebhookEndpoint()
        Gets webhook endpoint information.
        See Also:
        Get webhook endpoint information
      • setWebhookEndpoint

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.SetWebhookEndpointResponse> setWebhookEndpoint​(com.linecorp.bot.model.request.SetWebhookEndpointRequest request)
        Sets webhook endpoint URL.
        See Also:
        Set webhook URL
      • testWebhookEndpoint

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.TestWebhookEndpointResponse> testWebhookEndpoint​(com.linecorp.bot.model.request.TestWebhookEndpointRequest request)
        Tests webhook endpoint.
        See Also:
        Test webhook endpoint
      • getStatisticsPerUnit

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetStatisticsPerUnitResponse> getStatisticsPerUnit​(java.lang.String customAggregationUnit,
                                                                                                                                  java.lang.String from,
                                                                                                                                  java.lang.String to)
        Get statistics per aggregation unit.

        The API can only be used by corporate users who have submitted the required applications.

        See Also:
        Get statistics per unit
      • getAggregationUnitUsage

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetAggregationUnitUsageResponse> getAggregationUnitUsage()
        Get number of units used this month.

        The API can only be used by corporate users who have submitted the required applications.

        See Also:
        Get number of units used this month
      • getAggregationUnitNameList

        java.util.concurrent.CompletableFuture<com.linecorp.bot.model.response.GetAggregationUnitNameListResponse> getAggregationUnitNameList​(java.lang.String limit,
                                                                                                                                              java.lang.String start)
        Get name list of units used this month.

        The API can only be used by corporate users who have submitted the required applications.

        See Also:
        Get name list of units used this month