diff options
author | Joas Schilling <coding@schilljs.com> | 2019-10-10 11:17:08 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-10-10 11:19:23 +0200 |
commit | f1142ea0a38436442c5574a373ea11eb43ec1d38 (patch) | |
tree | 3e84310c0bd5b21f8542daa00299c841b519f839 /docs | |
parent | 227dbb913253bb21bdac37b38c11df3dbc38b65c (diff) |
Fix docs for participant handling
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/participant.md | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/docs/participant.md b/docs/participant.md index 08dab3976..4c4a8c4f1 100644 --- a/docs/participant.md +++ b/docs/participant.md @@ -10,7 +10,9 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1` * Response: - Header: + `200 OK` + + `403 Forbidden` When the participant is a guest + `404 Not Found` When the conversation could not be found for the participant + + `412 Precondition Failed` When the lobby is active and the user is not a moderator - Data: Array of participants, each participant has at least: @@ -37,8 +39,9 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1` * Response: - Header: + `200 OK` - + `403 Forbidden` When the current user is not a moderator/owner - + `400 Bad Request` When the source type is unknown + + `400 Bad Request` When the source type is unknown, currently `users`, `groups` and `emails` are supported + + `400 Bad Request` When the conversation is a one-to-one conversation + + `403 Forbidden` When the current user is not a moderator or owner + `404 Not Found` When the conversation could not be found for the participant + `404 Not Found` When the user or group to add could not be found @@ -61,40 +64,41 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1` * Response: - Header: + `200 OK` - + `400 Bad Request` When the participant is a moderator/owner and there are no other moderators/owners left. - + `403 Forbidden` When the current user is not a moderator/owner + + `400 Bad Request` When the participant is a moderator or owner + + `400 Bad Request` When there are no other moderators or owners left + + `403 Forbidden` When the current user is not a moderator or owner + `403 Forbidden` When the participant to remove is an owner + `404 Not Found` When the conversation could not be found for the participant + `404 Not Found` When the participant to remove could not be found -## Remove a guest from a conversation +## Remove yourself from a conversation * Method: `DELETE` -* Endpoint: `/room/{token}/participants/guests` -* Data: - - field | type | Description - ------|------|------------ - `participant` | string | Session ID of the guest to remove +* Endpoint: `/room/{token}/participants/self` * Response: - Header: + `200 OK` - + `403 Forbidden` When the current user is not a moderator/owner - + `403 Forbidden` When the target participant is not a guest + + `400 Bad Request` When the participant is a moderator or owner and there are no other moderators or owners left. + `404 Not Found` When the conversation could not be found for the participant - + `404 Not Found` When the target participant could not be found -## Remove yourself from a conversation +## Remove a guest from a conversation * Method: `DELETE` -* Endpoint: `/room/{token}/participants/self` +* Endpoint: `/room/{token}/participants/guests` +* Data: + + field | type | Description + ------|------|------------ + `participant` | string | Session ID of the guest to remove * Response: - Header: + `200 OK` - + `400 Bad Request` When the participant is a moderator/owner and there are no other moderators/owners left. + + `400 Bad Request` When the target participant is not a guest + + `403 Forbidden` When the current user is not a moderator or owner + `404 Not Found` When the conversation could not be found for the participant + + `404 Not Found` When the target participant could not be found ## Join a conversation (available for call and chat) @@ -128,7 +132,7 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1` + `200 OK` + `404 Not Found` When the conversation could not be found for the participant -## Promote a user to a moderator +## Promote a user or guest to moderator * Method: `POST` * Endpoint: `/room/{token}/moderators` @@ -136,18 +140,19 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1` field | type | Description ------|------|------------ - `participant` | string | User to promote + `participant` | string or null | User to promote + `sessionId` | string or null | Guest session to promote * Response: - Header: + `200 OK` - + `400 Bad Request` When the participant to promote is not a normal user (type `3`) - + `403 Forbidden` When the current user is not a moderator/owner + + `400 Bad Request` When the participant to promote is not a normal user (type `3`) or normal guest (type `4`) + + `403 Forbidden` When the current user is not a moderator or owner + `403 Forbidden` When the participant to remove is an owner + `404 Not Found` When the conversation could not be found for the participant + `404 Not Found` When the participant to remove could not be found -## Demote a moderator to a user +## Demote a moderator to user or guest * Method: `DELETE` * Endpoint: `/room/{token}/moderators` @@ -155,13 +160,15 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1` field | type | Description ------|------|------------ - `participant` | string | User to promote + `participant` | string or null | User to demote + `sessionId` | string or null | Guest session to demote * Response: - Header: + `200 OK` - + `400 Bad Request` When the participant to demote is not a moderator (type `2`) - + `403 Forbidden` When the current user is not a moderator/owner + + `400 Bad Request` When the participant to demote is not a moderator (type `2`) or guest moderator (type `6`) + + `403 Forbidden` When the current participant is not a moderator or owner + + `403 Forbidden` When the current participant tries to demote themselves + `404 Not Found` When the conversation could not be found for the participant + `404 Not Found` When the participant to demote could not be found |