api: Add GET /user_groups documentation.

This documents our GET endpoint for interacting with Zulip's user
groups feature.

Fixes #10298.
This commit is contained in:
Roman Godov
2018-08-19 00:06:53 +03:00
committed by Tim Abbott
parent 8c8cb725bf
commit aa3682f9fc
4 changed files with 109 additions and 0 deletions

View File

@@ -1895,6 +1895,46 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/JsonSuccess'
/user_groups:
get:
description: Get all user groups of the realm.
security:
- basicAuth: []
responses:
'200':
description: Success.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/JsonSuccess'
- properties:
user_groups:
type: array
items:
type: object
description: A list of `user_group` objects, which contain a
`description`, a `name`, their `id` and the list of members
of the user group.
- example:
{
"msg": "",
"result": "success",
"user_groups": [
{
"description": "Characters of Hamlet",
"id": 1,
"name": "hamletcharacters",
"members": [3, 4]
},
{
"description": "Other users",
"id": 2,
"name": "other users",
"members": [1, 2]
}
]
}
components:
#######################
# Security definitions