Lists all the channels on the workspace. Any of the following permissions are required:
view-c-room
view-joined-room
Changelog
Version | Description |
---|---|
0.49.0 | Count and offset query parameters supported. |
0.48.0 | Added |
The authToken
of the authenticated user.
The userId
of the authenticated user.
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.
List of fields to order by, and in which direction. This is a JSON object, with properties listed in desired order, with values of 1 for ascending, or -1 for descending. For example, {"value": -1, "_id": 1}. Refer to the official documentation to learn more.
This parameter allows you to use MongoDB query operators to search for specific data. For example, to query users with a name that contains the letter "g": query={ "name": { "$regex": "g" } }
. Refer to the official documentation to learn more.
This parameter accepts a JSON object with properties that have a value of 1 or 0 to include or exclude them in the response. For example, to only retrieve the usernames of users: fields={ "username": 1 }
. Refer to the official documentation to learn more.
OK
{
"channels": [
{
"_id": "GENERAL",
"ts": "2024-02-14T14:34:49.365Z",
"t": "c",
"name": "general",
"usernames": [],
"msgs": 6,
"usersCount": 6,
"_updatedAt": "2024-03-26T17:40:18.321Z",
"u": {
"_id": "rocket.cat",
"username": "rocket.cat",
"name": "Rocket.Cat"
},
"default": true
},
{
"_id": "65fd8a6bf581e473b56471ba",
"fname": "test-channel",
"_updatedAt": "2024-03-22T13:40:59.620Z",
"customFields": {},
"topic": "",
"broadcast": false,
"encrypted": false,
"name": "test-channel",
"t": "c",
"msgs": 0,
"usersCount": 1,
"u": {
"_id": "GdEsNbLxzoBgG8XoQ",
"username": "apiadmin",
"name": "apiadmin"
},
"ts": "2024-03-22T13:40:59.577Z",
"ro": false,
"default": false,
"sysMes": true
}
],
"count": 2,
"offset": 0,
"total": 3,
"success": true
}
Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}