Get all streams
Get all streams that the user has access to.
GET https://zulip.dioco.io/api/v1/streams
Usage examples
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Get all streams 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.
#!/usr/bin/env python3
import zulip
# Pass the path to your zuliprc file here.
client = zulip.Client(config_file="~/zuliprc")
# Get all streams 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)
curl -sSX GET -G https://zulip.dioco.io/api/v1/streams \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY
You may pass in one or more of the parameters mentioned above
as URL query parameters, like so:
curl -sSX GET -G https://zulip.dioco.io/api/v1/streams \
-u BOT_EMAIL_ADDRESS:BOT_API_KEY \
-d 'include_public=false'
Parameters
Note: The following parameters are all URL query parameters.
include_public optional
Example: False
Include all public streams.
Defaults to true
.
include_subscribed optional
Example: False
Include all streams that the user is subscribed to.
Defaults to true
.
include_all_active optional
Example: True
Include all active streams. The user must have administrative privileges
to use this parameter.
Defaults to false
.
include_default optional
Example: True
Include all default streams for the user's realm.
Defaults to false
.
include_owner_subscribed optional
Example: True
If the user is a bot, include all streams that the bot's owner is
subscribed to.
Defaults to false
.
Response
Return values
Example response
A typical successful JSON response may look like:
{
"msg": "",
"result": "success",
"streams": [
{
"description": "A Scandinavian country",
"invite_only": false,
"name": "Denmark",
"stream_id": 1
},
{
"description": "Yet another Italian city",
"invite_only": false,
"name": "Rome",
"stream_id": 2
},
{
"description": "Located in the United Kingdom",
"invite_only": false,
"name": "Scotland",
"stream_id": 3
},
{
"description": "A northeastern Italian city",
"invite_only": false,
"name": "Venice",
"stream_id": 4
},
{
"description": "A city in Italy",
"invite_only": false,
"name": "Verona",
"stream_id": 5
},
{
"description": "New stream for testing",
"invite_only": false,
"name": "new stream",
"stream_id": 6
}
]
}
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"
}