Add users to a group
Table of Contents
Note:
- Each time the zoho.connect.addUsersToGroup integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
- Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.connect.addUsersToGroup integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script.
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.comSample 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"}