Get Groups for User
Table of Contents
Overview
The zoho.one.getUserGroups task is used to fetch groups of a user using their ID within an organization.
Syntax
<response> = zoho.one.getUserGroups(<orgID>, <userID>, <page>, <perPage>, <connectionName>);
Scope
ZohoOne.Groups.READ
where:
Parameter | Description | Data type |
response | is the variable which will hold the details of the groups fetched from the organization. | KEY-VALUE |
<orgID> | is the ID of the organization from which the groups need to be fetched. | NUMBER |
<connectionName> | is the name of the Zoho One connection. | TEXT |
<userID> | is the ID of the user for whom all groups need to be fetched. | NUMBER |
<page> | To get the list of records based on pages. | NUMBER |
<per_page> | Maximum number of records (1-200) in a single page. | NUMBER |
Example: Fetch groups of a user from the specified organization
The following script fetches all the groups of a user in Zoho One organization:
response = zoho.one.getUserGroups(72XXXXXXX, 1510XXXXXXXX, "1", "200", "zoho_one_connection");
where:
response
This is the KEY-VALUEresponse returned by Zoho One.
72XXXXXXX
This is the NUMBERthat represents the organization ID of Zoho One account.
zoho_one_connection
This is the TEXTthat represents the link name of the connection.
1510XXXXXXXX
This is the NUMBERthat represents the user ID.
1
This is the NUMBERthat represents the index number of the first record that needs to be fetched.
200
This is the NUMBERthat represents the total number of records that needs to be fetched.
Response format
{
"status_code": 200,
"groups": [
{
"group_id": "70******",
"group_name": "Zo*****",
"group_type": 0,
"created_by": "790**************",
"group_description": ""
},
{
"group_id": "72******",
"group_name": "K******",
"group_type": 0,
"created_by": "790*************",
"group_description": ""
},...
],
"has_more": false,
"resource_name": "groups"
}
"status_code": 200,
"groups": [
{
"group_id": "70******",
"group_name": "Zo*****",
"group_type": 0,
"created_by": "790**************",
"group_description": ""
},
{
"group_id": "72******",
"group_name": "K******",
"group_type": 0,
"created_by": "790*************",
"group_description": ""
},...
],
"has_more": false,
"resource_name": "groups"
}