Add users to a group
Table of Contents
Overview
This task is used to add users to a specified group.
Only a network/group admin can add users to a group. Members who are part of the specified network will get added to the group on successful execution of this task. Members who are not a part of the network will receive an invite mail, and when the users accept the invite, they will get added to the group.
Note: This task can be executed only by network admins and group admins. For all others, a runtime error will be encountered.
Syntax
<variable> = zoho.connect.addUsersToGroup(<scopeID>, <partitionID>, <email>, <connectionName>);
where,
Parameter | Data type | Description |
<variable> | KEY-VALUE | is a variable which will hold the returned response. |
<scopeID> | NUMBER | is a variable which represents the Scope ID of the network. You can also fetch the scope ID from the response of myNetworks task. |
<partitionID> | NUMBER | is a variable which represents the Partition ID of the group to which the users will be added. You can also fetch the partition ID from the response of myGroups task. |
<email> | TEXT | is a variable which represents the email address of the user who will be added to the group. |
<connectionName> (optional)* | TEXT | is the name of the Zoho connect connection. *Note: This param is not applicable to Zoho Creator and mandatory in Zoho Cliq. |
Example
The following snippet adds a member with the email Id - john@zylker.com to a group using the Scope ID and Partition ID as specified below.
userDetails = zoho.connect.addUsersToGroup(105000017039001, 105000207776123, "john@zylker.com");
where,
userDetails
105000017039001
105000207776123
john@zylker.com
Sample Response
- Following is a response when the user is successfully added to the group.{"result":"success",
"profileUrl":"https://connect.zoho.com/portal/intranet/profile/57731234",
"isBot":"false",
"isGuest":"false",
"imageUrl":"https://contacts.zoho.com/file?t=user&ID=57731234&fs=thumb",
"name":"testuser",
"memberStatus":"1",
"timeZone":"IST",
"language":"en",
"emailId":"john@zylker.com",
"id":"57731234"} - The response returned is null when the Scope ID supplied is incorrect.
- The response below is obtained when either an invalid Partition ID or an invalid email address is supplied or when an email address out of the configured domain is supplied.{"response":"invalid request"}