Skip Navigation

METHOD_PC_UpdateRoomUsers

This method updates the members and managers in a group discussion.
The following table describes the parameters that you can include in this method.
Parameter
Type
Required
Description
roomId
String
This parameter specifies the ID of the group discussion to update members and managers for. 
membersToAdd
String Array
This parameter specifies a list of users or user groups to add to the group discussion. The category must allow users specified to be a member. Individual users and 
Active Directory
 user groups can be added as members. 
membersToRemove
String Array
This parameter specifies a list of members to remove from the group discussion. Individual users and 
Active Directory
 user groups can be removed from the members list. 
members
String Array
This parameter specifies a list of users to join the group discussion and participate as a member. This list replaces the existing members list. The room category must allow the user specified to be a member. Individual users and 
Active Directory
 user groups can be set as group discussion members.
managersToAdd
String Array
This parameter specifies a list of users or user groups to add as managers. The room category must allow the user or user group specified to be a manager. Individual users and 
Active Directory
 user groups can be added as managers.
managersToRemove
String Array
This parameter specifies a list of members to remove from the group discussion. Individual users and 
Active Directory
 user groups can be removed from the manager list.
managers
String Array
This parameter specifies users that can manage a group discussion. Managers are automatically added as members. This list replaces the existing managers list. Individual users and 
Active Directory
 user groups can be set as managers of a group discussion. 
Each group discussion must have one or more managers.

Notification

The following table describes the notification that 
BEMS
 might might send to the 
BlackBerry Connect
 app after it processes the request.
Parameter
Type
Description
innerError
Json Array
This parameter specifies an array of errors that might occur when updating group discussion members and managers. See InnerError below for more information.

InnerError

The following errors might occur when updating the group discussion members and managers:
  • The manager or member is not a valid instant messaging user or 
    Active Directory
     user group. 
  • The manager or member specified is not allowed to be a manager or member in the group discussion as per the category specification. 
  • A group discussion with the specified ID does not exist.
The following table describes the parameters that are included for innererrors. 
Parameter
Type
Description
type
String
This parameter specifies the error type. 
parameter
String
This parameter specifies parameter name if the error is caused by an input parameter. This is Optional. 
errorValues
String Array
This parameter specifies a list of invalid values. This is optional. 
message
String
This parameter specifies an error message. 
  • An empty members list removes all members from the group discussion.
  • If membersToAdd, managersToAdd, membersToRemove, and managersToRemove are provided, at least one of the parameters must contain a value.
  • The members and managers parameters replace all members and managers in the list respectively. MembersToAdd, membersToRemove provide members to add or remove from the list. As a result, both membersToAdd and membersToRemove parameters and members cannot be in the same request. 

Code example

The following example sends a request to 
BEMS
 to add and remove contacts in a group discussion.
{ "method":"pc.UpdateRoomUsers", "params": { "roomId":"ma-chan://gems.sw.rim.net/25ac15e7-9bff-4e78-9261-6e08aa43231e", "managersToAdd":[ "sip:user1@example.com", "sip:user2@example.com" ], "membersToRemove":[ "sip:user3@example.com", "sip:user4@example.com", "sip:user5@example.com" ] }, "id":"c5", "jsonrpc":"2.0" }
If the request is successful, 
BEMS
 sends the following response to the 
BlackBerry Connect
 app and processes the request.
{ "id":"c5", "error":null, "result": { "data": { "method":"pc.UpdateRoomUsers", "state":"PROCESSING" } }, "jsonrpc":"2.0" }
If there are errors, 
BEMS
 sends the following notification to the 
BlackBerry Connect
 app and the error message (for example, a user is not found). 
{ "id":"c5", "sequence":1018698900000014, "result": { "data": { "innerError":[ { "method":"pc.UpdateRoomUsers", "innerError":[ { "type":"parameterError", "parameter":"members", "errorValues":["sip:user1@example.com", "sip:user2@example.com"], "message":"User not found" } ], "method":"pc.UpdateRoomUsers", "state":"COMPLETE" } }, "jsonrpc":"2.0" }