Get Groups
Table of Contents
Overview
The zoho.one.getGroups task is used to fetch all the groups within an organization.
Syntax
<response> = zoho.one.getGroups(<orgID>, <page> , <per_page>, <queryParams>, <connectionName>);
Scope
ZohoOne.Groups.READWhere:
| 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 |
| <queryParams> | is the variable that holds the query parameters.
| KEY-VALUE |
| <page> | To get the list of records based on pages. | NUMBER |
| <per_page> | Maximum number of records (1-200) in a single page. | NUMBER |
| <connectionName> | is the name of the Zoho One connection. | TEXT |
The below-mentioned parameters can be used in <queryParams>:
Supported Includes:
| Parameters | Description |
| Emails | Including emails will provide the entire group's email information in the response. |
Example 1: Fetch all groups from the specified organization
The following script fetches the first 200 groups from Zoho One organization:
response = zoho.one.getGroups(72XXXXXXX, "1", "200", Map(), "zoho_one_connection");
where:
responseThis is the KEY-VALUEresponse returned by Zoho One.
72XXXXXXXThis is the NUMBERthat represents the organization ID of Zoho One account from which the groups need to be fetched.
zoho_one_connectionThis is the TEXTthat represents the link name of the connection.
1This is the NUMBERthat represents the index number of the first record that needs to be fetched.
200This is the NUMBERthat represents the total number of records that need to be fetched.
Example 2: Fetch all groups from the specified organization using "include"
The following script fetches the first 200 groups along with their email addresses from Zoho One organization using includes:
queryParams = Map(); filters = Map(); include = []; include.add("emails"); queryParams.put("include", include); response = zoho.one.getGroups(72XXXXXXX, "1", "200", queryParams, "zoho_one_connection")
where:
emailsThis is the VARIABLEthat represents the email addresses of users in the group that need to be fetched.
1This is the NUMBERthat represents the index number of the first record that needs to be fetched.
200This is the NUMBERthat represents the total number of records that need to be fetched.
Response format
{
"status_code": 200,
"groups": [
{
"emails": [
{
"email_id": "N******@*******.***",
"is_primary": true,
"is_alias": false,
"is_verified": true
}
],
"group_id": "70*******",
"group_name": "Zo******",
"group_type": 0,
"created_by": "79**************",
"group_description": "D************"
},
{
"group_id": "71*******",
"group_name": "IA*******",
"group_type": 0,
"created_by": "79***************",
"group_description": "G**************"
}
],
"has_more": false,
"resource_name": "groups"
}
"status_code": 200,
"groups": [
{
"emails": [
{
"email_id": "N******@*******.***",
"is_primary": true,
"is_alias": false,
"is_verified": true
}
],
"group_id": "70*******",
"group_name": "Zo******",
"group_type": 0,
"created_by": "79**************",
"group_description": "D************"
},
{
"group_id": "71*******",
"group_name": "IA*******",
"group_type": 0,
"created_by": "79***************",
"group_description": "G**************"
}
],
"has_more": false,
"resource_name": "groups"
}