public interface LineApiClient
| Modifier and Type | Method and Description |
|---|---|
LineApiResponse<LineAccessToken> |
getCurrentAccessToken()
Gets the access token that the SDK is using for the user.
|
LineApiResponse<GetFriendsResponse> |
getFriends(FriendSortField sortField,
java.lang.String nextPageRequestToken) |
LineApiResponse<GetFriendsResponse> |
getFriends(FriendSortField sortField,
java.lang.String nextPageRequestToken,
boolean isForOttShareMessage) |
LineApiResponse<GetFriendsResponse> |
getFriendsApprovers(FriendSortField sortField,
java.lang.String nextPageRequestToken) |
LineApiResponse<LineFriendshipStatus> |
getFriendshipStatus()
Gets the friendship status between the bot (which is linked to the current channel) and the user.
|
LineApiResponse<GetFriendsResponse> |
getGroupApprovers(java.lang.String groupId,
java.lang.String nextPageRequestToken) |
LineApiResponse<GetGroupsResponse> |
getGroups(java.lang.String nextPageRequestToken) |
LineApiResponse<GetGroupsResponse> |
getGroups(java.lang.String nextPageRequestToken,
boolean isForOttShareMessage) |
LineApiResponse<LineProfile> |
getProfile()
Gets the user profile information.
|
LineApiResponse<?> |
logout()
Revokes the access token.
|
LineApiResponse<LineAccessToken> |
refreshAccessToken()
Refreshes the access token that the SDK is using for the user.
|
LineApiResponse<java.lang.String> |
sendMessage(java.lang.String targetUserId,
java.util.List<MessageData> messages) |
LineApiResponse<java.util.List<SendMessageResponse>> |
sendMessageToMultipleUsers(java.util.List<java.lang.String> targetUserIds,
java.util.List<MessageData> messages) |
LineApiResponse<java.util.List<SendMessageResponse>> |
sendMessageToMultipleUsers(java.util.List<java.lang.String> targetUserIds,
java.util.List<MessageData> messages,
boolean isOttUsed)
Sends messages to multiple users on behalf of the current user.
|
LineApiResponse<LineCredential> |
verifyToken()
Checks whether the access token that the SDK is using for the user is valid.
|
@NonNull LineApiResponse<?> logout()
LineApiResponse object containing information about the response.@NonNull LineApiResponse<LineAccessToken> refreshAccessToken()
LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a LineAccessToken object that contains
a new access token. If the API call fails, the payload of the LineApiResponse
object is null.@NonNull LineApiResponse<LineCredential> verifyToken()
LineApiResponse object. If the access token is valid, the
LineApiResponse object contains a success response and the LineCredential
object that contains the access token. If the access token is invalid, the
LineApiResponse object contains a failure response.@NonNull LineApiResponse<LineAccessToken> getCurrentAccessToken()
LineApiResponse object. If the API call is successful,
a LineApiResponse object contains the LineAccessToken object that contains
the access token. If the API call fails, the payload of the LineApiResponse object is
null.@NonNull LineApiResponse<LineProfile> getProfile()
LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a LineProfile object that contains the
user's profile. If the API call fails, the payload of the LineApiResponse object is
null.@NonNull LineApiResponse<LineFriendshipStatus> getFriendshipStatus()
LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a LineFriendshipStatus object
that contains the friendship status information. If the API call fails, the payload of
the LineApiResponse object is null.@NonNull LineApiResponse<GetFriendsResponse> getFriends(@NonNull FriendSortField sortField, @Nullable java.lang.String nextPageRequestToken)
sortField - Optional. The way to sort the friend list. See the
FriendSortField section for more information.nextPageRequestToken - Optional. The continuation token to get the next friend list.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a GetFriendsResponse object that contains
up to 200 friends of the user. The GetFriendsResponse object also contains a
continuation token if there are remaining friends that the original API call didn't return.
If the API call fails, the payload of the LineApiResponse object is@NonNull LineApiResponse<GetFriendsResponse> getFriends(@NonNull FriendSortField sortField, @Nullable java.lang.String nextPageRequestToken, boolean isForOttShareMessage)
sortField - Optional. The way to sort the friend list. See the
FriendSortField section for more information.nextPageRequestToken - Optional. The continuation token to get the next friend list.isForOttShareMessage - True if this API is called for sharing messages with OTT,
false otherwise.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a GetFriendsResponse object that contains
up to 200 friends of the user. The GetFriendsResponse object also contains a
continuation token if there are remaining friends that the original API call didn't return.
If the API call fails, the payload of the LineApiResponse object is
null.FriendSortField@NonNull LineApiResponse<GetFriendsResponse> getFriendsApprovers(@NonNull FriendSortField sortField, @Nullable java.lang.String nextPageRequestToken)
sortField - Optional. The way to sort the friend list. See the
FriendSortField section for more information.nextPageRequestToken - Optional. The continuation token to get the next friend list.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a GetFriendsResponse object that contains
up to 200 friends of the user. The GetFriendsResponse object also contains a
continuation token if there are remaining friends that the original API call didn't return.
If the API call fails, the payload of the LineApiResponse object is
null.FriendSortField@NonNull LineApiResponse<GetGroupsResponse> getGroups(@Nullable java.lang.String nextPageRequestToken)
nextPageRequestToken - Optional. The continuation token to get the next group list.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a GetGroupsResponse object that contains
up to 200 groups that the user is a member of. The GetGroupsResponse object also
contains a continuation token if there are remaining groups that the original API call
didn't return. If the API call fails, the payload of the LineApiResponse object is
null.@NonNull LineApiResponse<GetGroupsResponse> getGroups(@Nullable java.lang.String nextPageRequestToken, boolean isForOttShareMessage)
nextPageRequestToken - Optional. The continuation token to get the next group list.isForOttShareMessage - True if this API is called for sharing messages with OTT,
false otherwise.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a GetGroupsResponse object that contains
up to 200 groups that the user is a member of. The GetGroupsResponse object also
contains a continuation token if there are remaining groups that the original API call
didn't return. If the API call fails, the payload of the LineApiResponse object is
null.@NonNull LineApiResponse<GetFriendsResponse> getGroupApprovers(@NonNull java.lang.String groupId, @Nullable java.lang.String nextPageRequestToken)
groupId - Required. The ID of the group to get its members.nextPageRequestToken - Optional. The continuation token to get the next member list.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains a GetFriendsResponse object that contains
up to 200 members. The GetFriendsResponse object also contains a continuation token
if there are remaining members that the original API call didn't return. If the API call
fails, the payload of the LineApiResponse object is null.@NonNull LineApiResponse<java.lang.String> sendMessage(@NonNull java.lang.String targetUserId, @NonNull java.util.List<MessageData> messages)
targetUserId - Required. The ID of the user or group that receives messages from the
current user.messages - Required. The messages to send. Available message types are: text, audio,
image, location, video, and template. You can send up to five messages.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains the delivery result. If the API call fails, the payload
of the LineApiResponse object is null. The delivery result is either of
the followings:
ok: The messages have been delivered successfully.discarded: The messages have been discarded because one of the conditions
above is met. This code is returned only when you attempt to send messages to a user.
MessageData@NonNull LineApiResponse<java.util.List<SendMessageResponse>> sendMessageToMultipleUsers(@NonNull java.util.List<java.lang.String> targetUserIds, @NonNull java.util.List<MessageData> messages)
targetUserIds - The IDs of the users that receive messages from the user. You can
specify up to 10 users.messages - The messages to send. Available message types are: text, audio, image,
location, video, and template. You can send up to five messages.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains the SendMessageResponse objects that contain
the delivery results. If the API call fails, the payload of the LineApiResponse
object is null. The delivery result is either of the followings:
ok: The messages have been delivered successfully.discarded: The messages have been discarded because one of the conditions
above is met or a server error occurred.
SendMessageResponse@NonNull LineApiResponse<java.util.List<SendMessageResponse>> sendMessageToMultipleUsers(@NonNull java.util.List<java.lang.String> targetUserIds, @NonNull java.util.List<MessageData> messages, boolean isOttUsed)
In the following cases, messages are not delivered even though the API call is successful. The response status is "discarded" for such API calls.
To call this method, you need a channel with the MESSAGE permission and an
access token with the message.write scope.
targetUserIds - The IDs of the users that receive messages from the user. You can
specify up to 10 users.messages - The messages to send. Available message types are: text, audio, image,
location, video, and template. You can send up to five messages.isOttUsed - True if you want to send messages using OTT instead of using the user ids;
false otherwise.LineApiResponse object. If the API call is successful, the
LineApiResponse object contains the SendMessageResponse objects that contain
the delivery results. If the API call fails, the payload of the LineApiResponse
object is null. The delivery result is either of the following:
ok: The messages have been delivered successfully.discarded: The messages have been discarded because one of the conditions
above is met or a server error occurred.
SendMessageResponse