Get subscribed streams
Get all streams that the user is subscribed to.
GET https://omegaletter.chat/api/v1/users/me/subscriptions
Usage examples
curl https://omegaletter.chat/api/v1/users/me/subscriptions \ -u BOT_EMAIL_ADDRESS:BOT_API_KEY
#!/usr/bin/env python3 import zulip # Download ~/zuliprc-dev from your dev server client = zulip.Client(config_file="~/zuliprc-dev") # Get all streams that the user is subscribed to result = client.list_subscriptions() print(result)
More examples and documentation can be found here.
const zulip = require('zulip-js'); // Download zuliprc-dev from your dev server const config = { zuliprc: 'zuliprc-dev', }; zulip(config).then((client) => { // Get all streams that the user is subscribed to client.streams.subscriptions.retrieve().then(console.log); });
Arguments
This request takes no arguments.
Response
Return values
subscriptions
: A list of dictionaries where each dictionary contains information about one of the subscribed streams.stream_id
: The unique ID of a stream.name
: The name of a stream.description
: A short description of a stream.invite-only
: Specifies whether a stream is invite-only or not. Only people who have been invited can access an invite-only stream.subscribers
: A list of email addresses of users who are also subscribed to a given stream.desktop_notifications
: A boolean specifiying whether desktop notifications are enabled for the given stream.push_notifications
: A boolean specifiying whether push notifications are enabled for the given stream.audible_notifications
: A boolean specifiying whether audible notifications are enabled for the given stream.pin_to_top
: A boolean specifying whether the given stream has been pinned to the top.email_address
: Email address of the given stream.in_home_view
: Whether the given stream is muted or not. Muted streams do not count towards your total unread count and thus, do not show up inAll messages
view (previously known asHome
view).color
: Stream color.
Example response
A typical successful JSON response may look like:
{ "msg": "", "result": "success", "subscriptions": [ { "audible_notifications": true, "color": "#e79ab5", "description": "A Scandinavian country", "desktop_notifications": true, "email_address": "Denmark+187b4125ed36d6af8b5d03ef4f65c0cf@zulipdev.com:9981", "in_home_view": true, "invite_only": false, "name": "Denmark", "pin_to_top": false, "push_notifications": false, "stream_id": 1, "subscribers": [ "ZOE@zulip.com", "hamlet@zulip.com", "iago@zulip.com", "othello@zulip.com", "prospero@zulip.com" ] }, { "audible_notifications": true, "color": "#e79ab5", "description": "Located in the United Kingdom", "desktop_notifications": true, "email_address": "Scotland+f5786390183e60a1ccb18374f9d05649@zulipdev.com:9981", "in_home_view": true, "invite_only": false, "name": "Scotland", "pin_to_top": false, "push_notifications": false, "stream_id": 3, "subscribers": [ "ZOE@zulip.com", "iago@zulip.com", "othello@zulip.com", "prospero@zulip.com" ] }, { "audible_notifications": true, "color": "#e79ab5", "description": "A city in Italy", "desktop_notifications": true, "email_address": "Verona+faaa92dc82cf143174ddc098a1c832ef@zulipdev.com:9981", "in_home_view": true, "invite_only": false, "name": "Verona", "pin_to_top": false, "push_notifications": false, "stream_id": 5, "subscribers": [ "AARON@zulip.com", "ZOE@zulip.com", "cordelia@zulip.com", "hamlet@zulip.com", "iago@zulip.com", "othello@zulip.com", "prospero@zulip.com" ] }, { "audible_notifications": false, "color": "#76ce90", "description": "New stream for testing", "desktop_notifications": false, "email_address": "new%0032stream+e1917b4fc733268e91fcc57cf79a9249@zulipdev.com:9981", "in_home_view": true, "invite_only": false, "name": "new stream", "pin_to_top": false, "push_notifications": false, "stream_id": 6, "subscribers": [ "iago@zulip.com" ] } ] }