Associated Groups of a User

Purpose

To get the groups that a user is associated with.

Request Details

Request URL

{api-domain}/crm/{version}/users/{user_ID}/actions/associated_groups

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.settings.user_groups.ALL/READ
(and)
scope=ZohoCRM.users.ALL/READ

Parameters

  • pageinteger, optional

    The page number from which you want to fetch the records. The default value is 1.

  • per_pageinteger, optional

    The number of records you want to fetch per page. You can choose a value between 1 and 200. The default and maximum value is 200.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v6/users/3652397000000186017/actions/associated_groups"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Response JSON

  • created_time

    The date and time in the ISO8601 format at which the group was created.

  • modified_time

    The date and time in the ISO8601 format at which the group was modified last.

  • name

    The name of the group that the user is associated with.

  • modified_by

    The name and ID of the user who last modified the details of the group.

  • description

    The description of the group.

  • id

    The unique ID of the group.

  • created_by

    The name and ID of the user who created the group.

  • info

    Contains the following details:

    • per_page - the maximum number of records that can be fetched per API call. The value is 200.
    • page - the page number from which the records are fetched in current API call.
    • count - the number of records that were fetched in the API call.
    • more_records - Represents if there are more records that can be fetched.

Possible Errors

  • NO_CONTENTHTTP 204

    There are no groups associated to that user.
    Resolution: Associate the user to one or more groups before trying this API.

  • INVALID_DATAHTTP 400

    The user ID is invalid.
    Resolution: Use the Get Users API to get the ID of the user.

Sample Response

Copied{
    "user_groups": [
        {
            "created_time": "2023-06-06T07:58:32+05:30",
            "modified_time": "2023-06-06T08:03:40+05:30",
            "name": "Tier1",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            },
            "description": null,
            "id": "3652397000012454002",
            "created_by": {
                "name": "Patricia Boyle",
                "id": "3652397000000186017"
            }
        }
    ],
    "info": {
        "per_page": 200,
        "count": 1,
        "page": 1,
        "more_records": false
    }
}