Open nikomatsakis opened 4 years ago
Hello @zulip/server-api members, this issue was labeled with the "area: documentation (api and integrations)" label, so you may want to check it out!
Howdy @nikomatsakis!
Doing streams is possible with: https://zulipchat.com/api/subscribe and https://zulipchat.com/api/unsubscribe (see the second examples involving "principals"), with the complications that:
include_subscribers: true
to get the current list (you could imagine an API that just set the stream membership, for example, and took care of the diff part for you).For user groups, you need the undocumented POST /user_groups/{user_group_id}/members
endpoint; you can easily see how it works using the Network tab in your browser when managing a user group.
I think this is something we should have a supported interface for; it's relevant in a lot of corporate environments. If you decide to write something with the Python API before we do something here, we would definitely love a contribution to add a sync_stream_membership(stream_id, user_ids)
method to https://github.com/zulip/python-zulip-api/blob/master/zulip/zulip/__init__.py that we can then document.
@akashaviator can you prioritize documenting that missing user group membership endpoint?
I looked at managing user groups from a bot but it seems that a bot cannot list user groups because the function serving the /user_groups/
endpoint, get_user_group
in views/user_groups.py
, is decorated with @require_member_or_admin
, which excludes bots:
and then the bot block
Would it make sense to open this for admin bots? (While I can see that you would be limiting bots in general, I am not quite sure I understand the rationale for limiting bots designated as admin nor how I might work around that limitation (I guess my idea for permissions would be "block by default" and then ORing decorators by creating a list attribute on the function and amending to that with chained decorators, so I could decorate the group editing callbacks with something like
@allow_member_or_admin
@allow_admin_bots
But that is getting off topic.)
I think it makes sense to just change this model; made a note of that in the #19525 issue.
@MSurfer20 FYI that we should also prioritize documenting all the user group related endpoints, since they will be an important focus for us with #19525.
Hi @zulipbot I'd like to work on this issue.
I am a candidate for the Outreachy program. I would like to be part of the Extend and polish Zulip's OpenAPI documentation project. I think this issue is something I can contribute as a new member of the community.
My skill sets are Python, Web, and technical writing.
@MarisaShang03 Welcome! Please take a look at the Zulip contributor guide for a detailed walk-through of how to get started. I also recommend checking out the #Outreachy stream in the Zulip development community.
Hello! On the rust project, we manage membership in our various teams and so forth via a central repository, so that commits to add members automatically adjust membership in the appropriate github teams and the like. I would like to have commits in that repository adjust membership of user groups or associated streams (especially private ones), but I've been told that there is no API for those kinds of synchronizations.
Apologies if the API exists already!