API - Update Group

Update Group

This API is used to update group name, code, description and custom properties.

API Details

Signature of API call

connection.invokeApi(String uri, String realUserName, Map<String, String> requestParameters);

See details about invoking API in general

 

Parameter 1 - URI

groupService.do

 

Parameter 2 - UserName

Username of the user (for my groups) and site admin(for site groups)

 

Parameter 3 - Request Parameters

Name Value
dispatch updateGroup
xml true
id Group ID
groupName New Name of the group
domain New Group Code
description New Group Description
maxUsers New value for maxUsers
allowedEmailDomains New value for allowed email domains
customProperties Group custom properties having key and value pairs

 

Response

Response on successfully updating the group

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<response code="0">
   <msgs>
      <msg>
         <code>0211</code>
         <value>
            <![CDATA[Group updated successfully]]>
         </value>
      </msg>
   </msgs>

</response>

 

Code Snippet

/* Check API Call for detail */

Map<String, String> parameters = new HashMap<String, String>();
populateMapForGroupUpdate(parameters);
String result = connection.invokeApi("groupService.do", "adminusername", parameters);
System.out.println(result);
 
private void populateMapForGroupUpdate(Map<String, String> parameters) {
    parameters.put("dispatch", "updateGroup");
    parameters.put("xml", String.valueOf(true));
    parameters.put("id", "<Group ID>");
    parameters.put("groupName", "New Group Name");
    parameters.put("domain", "Europe");
    parameters.put("description", "New group updated under by API");
    parameters.put("maxMembers", String.valueOf(50));
    parameters.put("allowedEmailDomains", “acme.com, mycompany.com”);
    parameters.put("customUpdPropMap['property1Name']","property1Value");
    parameters.put("customUpdPropMap['property2Name']","property2Value");
}

Rating: