Skip to content

Commit 57fafe4

Browse files
author
Hyunje Jun
committed
Update docs for new API methods
1 parent b5ee544 commit 57fafe4

File tree

1 file changed

+65
-3
lines changed

1 file changed

+65
-3
lines changed

docs/pages/api-reference/client.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ class Client {
1515
replyMessage(replyToken: string, messages: Message | Message[]): Promise<{}>
1616
multicast(to: string[], messages: Message | Message[]): Promise<{}>
1717
getProfile(userId: string): Promise<Profile>
18+
getGroupMemberProfile(groupId: string, userId: string): Promise<Profile>
19+
getRoomMemberProfile(roomId: string, userId: string): Promise<Profile>
20+
getGroupMemberIds(groupId: string): Promise<string[]>
21+
getRoomMemberIds(roomId: string): Promise<string[]>
1822
getMessageContent(messageId: string): Promise<ReadableStream>
1923
leaveGroup(groupId: string): Promise<{}>
2024
leaveRoom(roomId: string): Promise<{}>
@@ -23,7 +27,7 @@ class Client {
2327

2428
`Message` is a valid message object. About message object structure, please
2529
refer to [Send message object](https://devdocs.line.me/en/#send-message-object)
26-
of the official document.
30+
of the official documentation.
2731

2832
`ClientConfig` type is like below, except that it also allows fields
2933
from [MiddlewareConfig](./middleware.md) too.
@@ -39,7 +43,7 @@ type ClientConfig = {
3943
For a parameter `messages: messages: Message | Message[]`, you can provide a
4044
message object or an array of message objects. Both will work, but please beware
4145
that there can be a limit on the number of the messages to be sent
42-
simultaneously. About the API detail, please refer to [the official document](https://devdocs.line.me/en/#messaging-api).
46+
simultaneously. About the API detail, please refer to [the official documentation](https://devdocs.line.me/en/#messaging-api).
4347
4448
For functions returning `Promise`, there will be errors thrown if something
4549
goes wrong, such as HTTP errors or parsing errors. You can catch them with the
@@ -65,7 +69,7 @@ It corresponds to the [Reply message](https://devdocs.line.me/en/#reply-message)
6569
6670
The first argument is a reply token, which is retrieved from a webhook event
6771
object. For the list of replyable events, please refer to [Webhook event object](https://devdocs.line.me/en/#webhook-event-object)
68-
of the official document. The second argument is the same with one in `pushMessage()`.
72+
of the official documentation. The second argument is the same with one in `pushMessage()`.
6973
7074
``` js
7175
client.replyMessage(event.replyToken, {
@@ -100,6 +104,64 @@ client.getProfile('user_id').then((profile) => {
100104
});
101105
```
102106

107+
### `getGroupMemberProfile(groupId: string, userId: string): Promise<Profile>`
108+
109+
It corresponds to the [Group/Room Member Profile](https://devdocs.line.me/en/#get-group-room-member-profile) API.
110+
111+
*FYI: This feature is only available for LINE@ Approved accounts or official accounts.*
112+
113+
The arguments are a group ID and an ID of a user in the group. Please refer to
114+
the official documentation for the difference between this API and `getProfile()`.
115+
116+
``` js
117+
client.getGroupMemberProfile('group_id', 'user_id').then((profile) => {
118+
console.log(profile);
119+
})
120+
```
121+
122+
### `getRoomMemberProfile(roomId: string, userId: string): Promise<Profile>`
123+
124+
It corresponds to the [Group/Room Member Profile](https://devdocs.line.me/en/#get-group-room-member-profile) API.
125+
126+
*FYI: This feature is only available for LINE@ Approved accounts or official accounts.*
127+
128+
The arguments are a room ID and an ID of a user in the room. Please refer to the
129+
official documentation for the difference between this API and `getProfile()`.
130+
131+
``` js
132+
client.getRoomMemberProfile('room_id', 'user_id').then((profile) => {
133+
console.log(profile);
134+
})
135+
```
136+
137+
### `getGroupMemberIds(groupId: string): Promise<string[]>`
138+
139+
It corresponds to the [Group/Room Member IDs](https://devdocs.line.me/en/#get-group-room-member-ids) API.
140+
141+
*FYI: This feature is only available for LINE@ Approved accounts or official accounts.*
142+
143+
The argument is a group ID and the method returns a promise of an array of user IDs.
144+
145+
``` js
146+
client.getGroupMemberIds('group_id').then((ids) => {
147+
ids.forEach((id) => console.log(id));
148+
})
149+
```
150+
151+
### `getRoomMemberIds(roomId: string): Promise<string[]>`
152+
153+
It corresponds to the [Group/Room Member IDs](https://devdocs.line.me/en/#get-group-room-member-ids) API.
154+
155+
*FYI: This feature is only available for LINE@ Approved accounts or official accounts.*
156+
157+
The argument is a room ID and the method returns a promise of an array of user IDs.
158+
159+
``` js
160+
client.getRoomMemberIds('room_id').then((ids) => {
161+
ids.forEach((id) => console.log(id));
162+
})
163+
```
164+
103165
### `getMessageContent(messageId: string): Promise<ReadableStream>`
104166

105167
It corresponds to the [Content](https://devdocs.line.me/en/#content) API.

0 commit comments

Comments
 (0)