Skip to content

Commit 0517b95

Browse files
committed
docs for list of channels
1 parent 3badd9c commit 0517b95

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

docs/API/components/chat.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,16 @@ Fliplet.Hooks.on('beforeChatContactsRendering', function onBeforeChatContactsRen
9999

100100
## Private conversations
101101

102+
### Get the list of conversations for the current user
103+
104+
```js
105+
Fliplet.Chat.get().then(function (chat) {
106+
return chat.conversations();
107+
}).then(function (conversations) {
108+
// ...
109+
});
110+
```
111+
102112
### Create a new private conversation with a group of people
103113

104114
Use the Fliplet Chat JS APIs from the chat screen to create a new private conversation between multiple people.
@@ -108,11 +118,11 @@ You do not need to list the current user's entry ID in the list of participants,
108118
```js
109119
Fliplet.Chat.get().then(function (chat) {
110120
return chat.create({
111-
name: 'Running team', // Group name
121+
name: 'Running team', // Conversation name
112122
participants: [1, 2, 3] // List of Data source entry ID for the participants
113123
});
114-
}).then(function (channel) {
115-
// Group has been created
124+
}).then(function (conversation) {
125+
// The conversation has been created
116126
});
117127
```
118128

0 commit comments

Comments
 (0)