public class LineApiClientImpl extends java.lang.Object implements LineApiClient
LineApiClient.| Constructor and Description |
|---|
LineApiClientImpl(java.lang.String channelId,
LineAuthenticationApiClient oauthApiClient,
TalkApiClient talkApiClient,
AccessTokenCache accessTokenCache) |
| 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 sort,
java.lang.String nextPageRequestToken) |
LineApiResponse<GetFriendsResponse> |
getFriendsApprovers(FriendSortField sort,
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<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<LineCredential> |
verifyToken()
Checks whether the access token that the SDK is using for the user is valid.
|
public LineApiClientImpl(java.lang.String channelId,
LineAuthenticationApiClient oauthApiClient,
TalkApiClient talkApiClient,
AccessTokenCache accessTokenCache)
public LineApiResponse<?> logout()
LineApiClientlogout in interface LineApiClientLineApiResponse object containing information about the response.public LineApiResponse<LineAccessToken> refreshAccessToken()
LineApiClientrefreshAccessToken in interface LineApiClientLineApiResponse 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.public LineApiResponse<LineCredential> verifyToken()
LineApiClientverifyToken in interface LineApiClientLineApiResponse 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.public LineApiResponse<LineAccessToken> getCurrentAccessToken()
LineApiClientgetCurrentAccessToken in interface LineApiClientLineApiResponse 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.public LineApiResponse<LineProfile> getProfile()
LineApiClientgetProfile in interface LineApiClientLineApiResponse 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.public LineApiResponse<LineFriendshipStatus> getFriendshipStatus()
LineApiClientgetFriendshipStatus in interface LineApiClientLineApiResponse 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.public LineApiResponse<GetFriendsResponse> getFriends(FriendSortField sort, java.lang.String nextPageRequestToken)
getFriends in interface LineApiClientsort - 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.FriendSortFieldpublic LineApiResponse<GetFriendsResponse> getFriendsApprovers(FriendSortField sort, java.lang.String nextPageRequestToken)
getFriendsApprovers in interface LineApiClientsort - 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.FriendSortFieldpublic LineApiResponse<GetGroupsResponse> getGroups(java.lang.String nextPageRequestToken)
getGroups in interface LineApiClientnextPageRequestToken - 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.public LineApiResponse<GetFriendsResponse> getGroupApprovers(java.lang.String groupId, java.lang.String nextPageRequestToken)
getGroupApprovers in interface LineApiClientgroupId - 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.public LineApiResponse<java.lang.String> sendMessage(java.lang.String targetUserId, java.util.List<MessageData> messages)
sendMessage in interface LineApiClienttargetUserId - 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.
MessageDatapublic LineApiResponse<java.util.List<SendMessageResponse>> sendMessageToMultipleUsers(java.util.List<java.lang.String> targetUserIds, java.util.List<MessageData> messages)
sendMessageToMultipleUsers in interface LineApiClienttargetUserIds - 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