GET https://z.u1v.ru/api/v1/users/me/{stream_id}/topics
Get all topics the user has access to in a specific channel.
Note that for private channels with
protected history,
the user will only have access to topics of messages sent after they
subscribed to the channel. Similarly, a user's
bot will only have access to messages
sent after the bot was subscribed to the channel, instead of when the
user subscribed.
Changes: Before Zulip 12.0 (feature level 480), this
endpoint was not supported for archived channels.
Usage examples
Python
JavaScript
curl
#!/usr/bin/env python3importpero# Pass the path to your perorc file here.client=pero.Client(config_file="~/.perorc")result=client.get_stream_topics(stream_id)print(result)
More examples and documentation can be found here.
constzulipInit=require("zulip-js");// Pass the path to your perorc file here.constconfig={zuliprc:"perorc"};(async()=>{constclient=awaitzulipInit(config);// Get all the topics in channel with ID 1console.log(awaitclient.streams.topics.retrieve({stream_id:1}));})();
The -u line implements HTTP Basic authentication.
See the Authorization header documentation for how
to get those credentials for users and bots.
Whether the client supports processing the empty string as
a topic name in the returned data.
If false, the value of realm_empty_topic_display_name
found in the POST /register response is
returned replacing the empty string as the topic name.
Changes: New in Zulip 10.0 (feature level 334). Previously,
the empty string was not a valid topic.
Defaults to false.
Response
Return values
supports_empty_topics: boolean
Product extension. Supports explicit topic creation before
the first message. Empty registered topics have max_id zero.
supports_topic_icons: boolean
Product extension. True when shared topic icon writes
are supported. This does not grant the caller edit permission.
topics: (object)[]
An array of objects with information about user-accessible
topics in the specified channel, sorted by recency (i.e.,
the topic with the most recent message is ordered first).
icon: object
Shared topic icon, independent of the topic name.
Omitted when no icon has been assigned. Product extension.
emoji_name: string
The selected emoji name.
emoji_code: string
The emoji code used by message reactions.
reaction_type: string
The emoji namespace.
max_id: integer
The message ID of the last message sent to this topic.
name: string
The name of the topic.
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.
An example JSON response for when the user is attempting to fetch the topics
of a non-existing channel (or also a private channel they don't have access to):