Get all channels
GET https://zulip.heado.ru/api/v1/streams
Get all channels that the user has access to.
Usage examples
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Get all channels that the user has access to.
result = client.get_streams()
# You may pass in one or more of the query parameters mentioned above
# as keyword arguments, like so:
result = client.get_streams(include_public=False)
print(result)
More examples and documentation can be found here.
const zulipInit = require("zulip-js");
// Pass the path to your zuliprc file here.
const config = { zuliprc: "zuliprc" };
(async () => {
const client = await zulipInit(config);
// Get all channels that the user has access to
console.log(await client.streams.retrieve());
})();
curl -sSX GET -G https://zulip.heado.ru/api/v1/streams \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY
You may pass in one or more of the parameters mentioned below
as URL query parameters, like so:
curl -sSX GET -G https://zulip.heado.ru/api/v1/streams \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
--data-urlencode include_public=false
Parameters
include_public boolean optional
Example: false
Include all public channels.
Defaults to true
.
include_web_public boolean optional
Example: true
Include all web-public channels.
Defaults to false
.
include_subscribed boolean optional
Example: false
Include all channels that the user is subscribed to.
Defaults to true
.
include_all_active boolean optional
Example: true
Include all active channels. The user must have administrative privileges
to use this parameter.
Defaults to false
.
include_default boolean optional
Example: true
Include all default channels for the user's realm.
Defaults to false
.
include_owner_subscribed boolean optional
Example: true
If the user is a bot, include all channels that the bot's owner is
subscribed to.
Defaults to false
.
Response
Return values
Example response(s)
Changes: As of Zulip 7.0 (feature level 167), if any
parameters sent in the request are not supported by this
endpoint, a successful JSON response will include an
ignored_parameters_unsupported
array.
A typical successful JSON response may look like:
{
"msg": "",
"result": "success",
"streams": [
{
"can_remove_subscribers_group": 10,
"creator_id": null,
"date_created": 1691057093,
"description": "A private channel",
"first_message_id": 18,
"history_public_to_subscribers": false,
"invite_only": true,
"is_announcement_only": false,
"is_default": false,
"is_web_public": false,
"message_retention_days": null,
"name": "management",
"rendered_description": "<p>A private channel</p>",
"stream_id": 2,
"stream_post_policy": 1,
"stream_weekly_traffic": null
},
{
"can_remove_subscribers_group": 9,
"creator_id": 12,
"date_created": 1691057093,
"description": "A default public channel",
"first_message_id": 21,
"history_public_to_subscribers": true,
"invite_only": false,
"is_announcement_only": false,
"is_default": true,
"is_web_public": false,
"message_retention_days": null,
"name": "welcome",
"rendered_description": "<p>A default public channel</p>",
"stream_id": 1,
"stream_post_policy": 1,
"stream_weekly_traffic": null
}
]
}
An example JSON response for when the user is not authorized to use the
include_all_active
parameter (i.e. because they are not an organization
administrator):
{
"code": "BAD_REQUEST",
"msg": "User not authorized for this query",
"result": "error"
}