用户组
在Zoho CRM中,您可以创建不同类型的组(Users集)来管理一组共同的记录。每个组可以由基于Users、角色、角色及其下属、区域和子区域分组的成员组成。这些组合允许您通过数据共享规则共享共同的记录。有关更多详细信息,请参阅Users和组。
目的
获取为您的组织创建的用户组的详细信息。
端点
- GET /settings/user_groups
- GET /settings/user_groups/{group_ID}
请求详情
请求 URL
获取所有用户组 - {api-domain}/crm/{version}/settings/user_groups
获取特定用户组 - {api-domain}/crm/{version}/settings/user_groups/{user_group_id}
标题
授权: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
范围
scope=ZohoCRM.settings.user_groups.READ
参数
- include optional
此参数取值sources_count,用于显示该组所属的其他组(角色、领地等)的数量。
- name optional
当您想按名称筛选用户组时,请使用此参数。
- page optional
从相应页面获取记录列表。页面的默认值为1。可能的值:仅正整数值。
- per_page optional
获取每页可用的记录列表。默认值和最大可能值为200。可能的值:仅正整数值。
- filters string,optional
该参数允许您筛选用户组。
以下是提供在filters参数中的单一条件的JSON结构:
{
"field": {
"api_name": "name"
},
"comparator": "{{comparator_value}}",
"value": "{{user_group_API_name}}"
}
以下是提供在filters参数中的多个条件的JSON结构:
{
"group_operator": "and",
"group": [
{
"field": {
"api_name": "名称"
},
"comparator": "{{comparator_value}}",
"value": "{{user_group_API_name}}"
},
{
"field": {
"api_name": "名称"
},
"comparator": "{{comparator_value}}",
"value": "{{value}}"
}
]
}
- fieldsJSON object,mandatory
表示用于过滤用户组的字段。
- api_namestring,mandatory
表示要查询的过滤器的 API 名称。支持的值:"name"
- comparatorstring,mandatory
表示在条件中使用的比较运算符。支持的值: "contains" 和 "starts_with"
- valuestring,mandatory
指定在条件中使用的值。使用用户组 API指定用户组的 API 名称。
- group_operatorstring(在指定group键时,必须包含group_operator键。)
表示在条件中使用的组操作符。支持的值:"and"
- groupJSON array
表示用于检索用户组的条件组。
示例请求包含 "include=sources_count"
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/user_groups?include=sources_count"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"示例响应
Copied{
"user_groups": [
{
"created_time": "2022-11-21T12:33:12+05:30",
"sources_count": {
"territories": 1,
"roles": 2,
"users": 2
},
"modified_time": "2022-11-21T13:21:46+05:30",
"name": "group 1",
"modified_by": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"description": "groups API",
"id": "3652397000009949005",
"created_by": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
}
},
{
"created_time": "2022-11-23T9:59:12+05:30",
"sources_count": {
"users": 2
},
"modified_time": null,
"name": "group test",
"modified_by": null,
"description": null,
"id": "3652397000009952001",
"created_by": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
}
}
],
"info": {
"per_page": 200,
"count": 2,
"page": 1,
"more_records": false
}
}可能的错误
- NO_CONTENTHTTP 204
您的组织没有创建用户组。
解决方法:在设置 > Users & 控制 > Users > 组 > 创建新组中创建用户组。 - NO_PERMISSIONHTTP 403
您没有查看用户组的权限。
解决方法:联系您的系统管理员。
示例请求包含 "name"
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/user_groups?name=group 1"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"示例响应
Copied{
"user_groups": [
{
"created_time": "2022-11-21T12:33:12+05:30",
"sources_count": {
"territories": 1,
"roles": 2,
"users": 2
},
"modified_time": "2022-11-21T13:21:46+05:30",
"name": "group 1",
"modified_by": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"description": "groups API",
"id": "3652397000009949005",
"created_by": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
}
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}注意
在发送请求之前对 filters 参数的值进行编码。
使用 "filters" 参数中的 "单一条件" 的示例请求
Copiedcurl "https://www.zohoapis.com/crm/v8/settings/user_groups?filters=%7B%22field%22%3A%20%7B%22api_name%22%3A%20%22name%22%7D%2C%22comparator%22%3A%20%22starts_with%22%2C%20%22value%22%3A%20%22Test%22%7D"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"示例响应
Copied{
"user_groups": [
{
"created_time": "2024-07-08T21:37:06+05:30",
"modified_time": "2024-07-08T21:37:19+05:30",
"name": "Test",
"modified_by": {
"name": "Patricia",
"id": "2276164000000471001"
},
"description": null,
"id": "2276164000001042069",
"created_by": {
"name": "Patricia",
"id": "2276164000000471001"
}
}
],
"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}
}