Get
/api/v1/rooms.getDiscussions
Get all discussions of a room.
Changelog
| Version | Description |
|---|---|
| 9.0.0 | Removed the fields and query parameters. |
| 1.0.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Query parameters
roomName
string
The room name. It is required if the roomId is not provided.
Examplegeneral
roomId
string
The room ID. It is required if the roomName is not provided.
Exampledlpfuijw7ej
Example50
offset
integer
Number of items to "skip" in the query, i.e. requests return count items, skipping the first offset items. Refer to the official documentation to learn more.
Example50
sort
string
Sort the channels in ascending (1) or descending (-1) order. The value must be entered as a JSON object. The options are as follows:
fname: Sort by discussion name. For example,sort={"fname":1}(this is the default sorting mechanism).ts: Sort by creation timestamp. For example,sort={"ts":-1}usersCount: Sort by number of users. For example,sort={"usersCount":1}
Responses
200
OK
Success
{
"discussions": [
{
"_id": "6514d34ea2f73c7460e18cb4",
"fname": "test-discussion",
"_updatedAt": "2023-09-28T01:14:04.275Z",
"topic": "general",
"prid": "GENERAL",
"encrypted": false,
"name": "M75nSgA3uYsnTbKRu",
"t": "c",
"msgs": 1,
"usersCount": 1,
"u": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie",
"name": "test test"
},
"ts": "2023-09-28T01:13:50.574Z",
"ro": false,
"default": false,
"sysMes": true,
"lastMessage": {
"_id": "pnm4kh84HfncDEZj7",
"rid": "6514d34ea2f73c7460e18cb4",
"msg": "Hi guys , this is for SWE team",
"ts": "2023-09-28T01:14:04.119Z",
"u": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie",
"name": "test test"
},
"_updatedAt": "2023-09-28T01:14:04.233Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Hi guys , this is for SWE team"
}
]
}
]
},
"lm": "2023-09-28T01:14:04.119Z"
}
],
"count": 1,
"offset": 0,
"total": 1,
"success": true
}object
discussions
Array of object
object
_id
string
fname
string
_updatedAt
string
topic
string
prid
string
encrypted
boolean
name
string
t
string
msgs
integer
usersCount
integer
u
object
_id
string
username
string
name
string
ts
string
ro
boolean
default
boolean
sysMes
boolean
lastMessage
object
_id
string
rid
string
msg
string
ts
string
u
object
_id
string
username
string
name
string
_updatedAt
string
urls
Array of object
object
mentions
Array of object
object
channels
Array of object
object
md
Array of object
object
type
string
value
Array of object
object
type
string
value
string
lm
string
count
integer
offset
integer
total
integer
success
boolean
401
Unauthorized
Authorization Error
{
"success": false,
"error": "You must be logged in to do this."
}object
success
boolean
error
string