Fuselage
Powered By GitBook
Create Discussion
REST API Create Discussion Methods
Creates a new discussion for room. It requires at least one of the following permissions: start-discussion OR start-discussion-other-user, AND must be with the following setting enabled: Discussion_enabled.
URL
Requires Auth
HTTP Method
/api/v1/rooms.createDiscussion
yes
POST

Payload

Argument
Example
Required
Description
prid
GENERAL
Required
Parent room id of the discussion.
t_name
discussion name
Required
Discussion name.
users
['rocket.cat']
Optional
Array of users to join in the discussion, if not provide will be an empty array (Note: if provided, it must be an array).
pmid
aobEgbghXfe543keqG
Optional
Parent message id (if the discussion comes from a message).
reply
reply of this discussion
Optional
The reply of the discussion.

Example Call

1
curl -H "X-Auth-Token: 9HqLlyZOugoStsXCUfD_0YdwnNnunAJF8V47U3QHXSq" \
2
-H "X-User-Id: aobEdbYhXfu5hkeqG" \
3
-H "Content-Type: application/json" \
4
http://localhost:3000/api/v1/rooms.createDiscussion \
5
-d '{ "prid": "GENERAL", "t_name": "Discussion Name"}'
Copied!

Example Result

1
{
2
"discussion": {
3
"rid": "cgk88DHLHexwMaFWh",
4
"name": "WJNEAM7W45wRYitHo",
5
"fname": "Discussion Name",
6
"t": "p",
7
"msgs": 0,
8
"usersCount": 0,
9
"u": {
10
"_id": "rocketchat.internal.admin.test",
11
"username": "rocketchat.internal.admin.test"
12
},
13
"topic": "general",
14
"prid": "GENERAL",
15
"ts": "2019-04-03T01:35:32.271Z",
16
"ro": false,
17
"sysMes": true,
18
"default": false,
19
"_updatedAt": "2019-04-03T01:35:32.280Z",
20
"_id": "cgk88DHLHexwMaFWh"
21
},
22
"success": true
23
}
Copied!

Change Log

Version
Description
1.0.0
Added
Last modified 6mo ago
Export as PDF
Copy link