-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#128 Send invitations to affiliated users and groups
#129 New endpoint to send invitations to selected users and groups
- Loading branch information
1 parent
4373cd1
commit 9bd4d7d
Showing
10 changed files
with
459 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -804,9 +804,10 @@ Endpoint to create a new chat room. | |
|
||
### Possible parameters | ||
|
||
| Parameter | Parameter Type | Description | Default value | | ||
|-------------|-----------------|-------------------------------------|---------------| | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------------|-----------------|-------------------------------------------------|---------------| | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| sendInvitations | @QueryParam | Whether to send invitations to affiliated users | false | | ||
|
||
### XML Examples | ||
|
||
|
@@ -1125,10 +1126,11 @@ Endpoint to update a chat room. | |
|
||
### Possible parameters | ||
|
||
| Parameter | Parameter Type | Description | Default value | | ||
|-------------|-----------------|------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------------|-----------------|-------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| sendInvitations | @QueryParam | Whether to send invitations to newly affiliated users | false | | ||
|
||
### Examples | ||
>**Header:** Authorization: Basic YWRtaW46MTIzNDU= | ||
|
@@ -1178,9 +1180,9 @@ Endpoint to update a chat room. | |
</chatRoom> | ||
``` | ||
|
||
## Invite user to a chat Room | ||
## Invite user or user group to a chat Room | ||
|
||
Endpoint to invite a user to a room. | ||
Endpoint to invite a user or a user group to a room. | ||
> **Header:** Authorization: Basic YWRtaW46MTIzNDU= | ||
> | ||
> **Header:** Content-Type: application/xml | ||
|
@@ -1198,10 +1200,40 @@ Endpoint to invite a user to a room. | |
**Return value:** HTTP status 200 (OK) | ||
|
||
### Possible parameters | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------|-----------------|------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| name | @Path | The local username or the user JID | | | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------|-----------------|---------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| name | @Path | The local username or group name or the user JID or group JID | | | ||
|
||
## Invite multiple users and/or user groups to a chat Room | ||
|
||
Endpoint to invite multiple users and/or user groups to a room. Works both with JIDs and (user/group) names. | ||
> **Header:** Authorization: Basic YWRtaW46MTIzNDU= | ||
> | ||
> **Header:** Content-Type: application/xml | ||
> | ||
> **POST** http://localhost:9090/plugins/restapi/v1/chatrooms/{roomName}/invite | ||
**Payload Example:** | ||
|
||
```xml | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<mucInvitation> | ||
<reason>Hello, come to this room, it is nice</reason> | ||
<jidsToInvite> | ||
<jid>[email protected]</jid> | ||
<jid>[email protected]/695c6ae413c00446733d926ccadefd8b</jid> | ||
<jid>john</jid> | ||
<jid>SomeGroupName</jid> | ||
</jidsToInvite> | ||
</mucInvitation> | ||
``` | ||
**Return value:** HTTP status 200 (OK) | ||
|
||
### Possible parameters | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------|-----------------|---------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
|
||
## Get all users with a particular affiliation in a chat room | ||
Retrieves a list of JIDs for all users with the specified affiliation in a multi-user chat room. | ||
|
@@ -1246,12 +1278,13 @@ Endpoint to add a new user with affiliation to a room. | |
|
||
### Possible parameters | ||
|
||
| Parameter | Parameter Type | Description | Default value | | ||
|-------------|-----------------|--------------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| name | @Path | The local username or the user JID | | | ||
| affiliation | @Path | Available affiliations: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------------|-----------------|--------------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| name | @Path | The local username or the user JID | | | ||
| affiliation | @Path | Available affiliations: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| sendInvitations | @QueryParam | Whether to send invitation to the newly affiliated user | false | | ||
|
||
### Examples | ||
>**Header:** Authorization: Basic YWRtaW46MTIzNDU= | ||
|
@@ -1264,7 +1297,7 @@ Endpoint to add a new user with affiliation to a room. | |
> | ||
>**POST** http://example.org:9090/plugins/restapi/v1/chatrooms/global/admins/testUser | ||
> | ||
>**POST** http://example.org:9090/plugins/restapi/v1/chatrooms/global/members/testUser | ||
>**POST** http://example.org:9090/plugins/restapi/v1/chatrooms/global/members/testUser?sendInvitations=true | ||
> | ||
>**POST** http://example.org:9090/plugins/restapi/v1/chatrooms/global/outcasts/testUser | ||
> | ||
|
@@ -1280,11 +1313,12 @@ Endpoint to replace all users with a particular affiliation in a multi-user chat | |
|
||
### Possible parameters | ||
|
||
| Parameter | Parameter Type | Description | Default value | | ||
|-------------|-----------------|--------------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| affiliation | @Path | Available affiliations: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------------|-----------------|--------------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| affiliation | @Path | Available affiliations: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| sendInvitations | @QueryParam | Whether to send invitation to newly affiliated users | false | | ||
|
||
### Examples | ||
>**Header:** Authorization: Basic YWRtaW46MTIzNDU= | ||
|
@@ -1312,11 +1346,12 @@ Endpoint to add multiple users with an affiliation to a multi-user chat room. No | |
|
||
### Possible parameters | ||
|
||
| Parameter | Parameter Type | Description | Default value | | ||
|--------------|-----------------|-------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| affiliation | @Path | Available affiliation: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------------|-----------------|-------------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| affiliation | @Path | Available affiliation: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| sendInvitations | @QueryParam | Whether to send invitations to newly affiliated users | false | | ||
|
||
### Examples | ||
>**Header:** Authorization: Basic YWRtaW46MTIzNDU= | ||
|
@@ -1344,12 +1379,13 @@ Endpoint to add a new group with affiliation to a room. | |
|
||
### Possible parameters | ||
|
||
| Parameter | Parameter Type | Description | Default value | | ||
|-------------|----------------|--------------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| name | @Path | The group name | | | ||
| affiliation | @Path | Available affiliations: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| Parameter | Parameter Type | Description | Default value | | ||
|-----------------|----------------|--------------------------------------------------------------------------------------------|---------------| | ||
| roomname | @Path | Exact room name | | | ||
| name | @Path | The group name | | | ||
| affiliation | @Path | Available affiliations: <br>**owners** <br> **admins** <br> **members** <br> **outcasts** | | | ||
| servicename | @QueryParam | The name of the Group Chat Service | conference | | ||
| sendInvitations | @QueryParam | Whether to send invitations to the users in the newly affiliated groups | false | | ||
|
||
### Examples | ||
>**Header:** Authorization: Basic YWRtaW46MTIzNDU= | ||
|
Oops, something went wrong.