用户的领地
目的
获取与用户相关的领土。
端点
- GET /users/{user_id}/territories
- GET /users/{user_id}/territories/{territory_id}
请求详情
请求 URL
获取用户的所有区域 - {api-domain}/crm/{version}/users/{id}/territories
获取用户的特定区域 - {api-domain}/crm/{version}/users/{id}/territories/{territory_id}
标题
授权: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
范围
scope=ZohoCRM.users.{operation_type}
(或)
scope=ZohoCRM.settings.territories.{operation_type}
可能的操作类型
ALL - 完全访问记录
READ - 从模块获取记录
示例请求
Copiedcurl "https://www.zohoapis.com/crm/v8/users/3652397000000186017/territories"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
-X GETCopiedresponse = invokeurl
[
url: "https://www.zohoapis.com/crm/v8/users/3652397000000186017/territories"
type: GET
connection:"crm_oauth_connection"
];
info response;响应 JSON 键
响应 JSON 在 "info" 对象中的键(仅在获取与用户相关的所有领土时)
- id string
表示用户所属区域的唯一ID。
- 经理JSON object
表示该区域经理的姓名和ID。
- Name string
表示领土的Name。
- Reporting_ToJSON object
表示父级区域的名称和ID。对于父级区域,此值为null。
- per_page integer
表示在一次 API 调用中可以获取的记录数量。最大值为 200。
- count integer
表示在此 API 调用中获取的记录数。
- page integer
表示获取记录的页码。默认值为1。
- more_records boolean
表示模块中是否有更多记录需要获取。
可能的错误
- INVALID_DATAHTTP 400
您指定的用户ID、区域ID或两者之一无效。
解决方法:响应中的resource_path_index会告诉您请求中无效ID的位置。请指定一个有效的ID。
示例响应
Copied{
"territories": [
{
"id": "3652397000000715341",
"Manager": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Name": "USA",
"Reporting_To": null
},
{
"id": "3652397000007612003",
"Manager": {
"name": "Jane Smith",
"id": "3652397000000281001"
},
"Name": "Texas",
"Reporting_To": {
"id": "3652397000000715341",
"Name": "USA"
}
},
{
"id": "3652397000007612015",
"Manager": {
"name": "Jane Smith",
"id": "3652397000000281001"
},
"Name": "Washington",
"Reporting_To": {
"id": "3652397000000715341",
"Name": "USA"
}
},
{
"id": "3652397000007622003",
"Manager": {
"name": "Patricia Boyle",
"id": "3652397000000186017"
},
"Name": "New York",
"Reporting_To": {
"id": "3652397000000715341",
"Name": "USA"
}
}
],
"info": {
"per_page": 200,
"count": 4,
"page": 1,
"more_records": false
}
}