Zoho crm Logo

转移和删除领土

目的

要在您的ZohoCRM组织中Delete包含子区域的区域。这些区域不能通过Delete区域API直接Delete。使用此API,您可以将子区域转移到另一个父区域,并Delete您想要Delete的区域。

端点

  • POST /settings/territories/actions/transfer_and_delete
  • POST /settings/territories/{territory_ID}/actions/transfer_and_delete

请求详情

请求URL

要转移并删除一个特定的区域:
{api-domain}/crm/{version}/settings/territories/{territory_ID}/actions/transfer_and_delete

要转移并删除多个区域:
{api-domain}/crm/{version}/settings/territories/actions/transfer_and_delete

标题

授权: Zoho-oauthtokend92d4xxxxxxxxxxxxx15f52

范围

范围=ZohoCRM.设置.区域.所有
 

示例请求

Copiedcurl "https://www.zohoapis.com/crm/v8/settings/territories/actions/transfer_and_delete"
-X POST
-d "@deleteterritories.json"
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

在请求中,"@deleteterritories.json" 包含示例输入。

请求 JSON
  • id 字符串,如果端点中未提及 ID,则为必填项

    要删除的辖区的唯一 ID。请使用获取辖区 API来获取辖区的 ID。

  • delete_previous_forecasts 布尔值,必填

    删除该地区之前做出的预测

  • transfer_to_id 编号,必填

    子区域必须转移到的父区域。此区域不能与您要删除的区域处于同一级别。

注意

子辖区不能被转移到比其当前父辖区层级更低的辖区。

一次 API 调用最多可以删除 10 个辖区

示例请求

Copied{
    "territories" : [
     {
            "id" : "431581000000734117",
            "transfer_to_id" : "431581000000734217",
            "delete_previous_forecasts":false
     }
   ]
}
  

可能的错误

  • INVALID_DATA HTTP 400
    • Transfer_to_id 与当前父级辖区相同
    • Transfer_to_id 不是有效的辖区
    • Transfer_to_id 并不比当前父级辖区层级更高
    • 无法更新组织辖区属性,除非是名称

    解决方法:请参考响应中的 "details" 键,以获取输入中有错误字段的 API 名称。

  • OAUTH_SCOPE_MISMATCH HTTP 401

    您用于此 API 调用的访问令牌不具备所需的权限范围(scope)。
    解决方法:请生成一个具有该 API 所需权限范围的新访问令牌。有关所需权限范围的列表,请参阅本页开头的权限范围部分。

  • INVALID_URL_PATTERN HTTP 404

    请求的URL不正确。
    解决方法:请指定一个有效的请求URL。更多详细信息,请参考本页开头的请求URL部分。

  • INTERNAL_ERROR HTTP 500

    服务器出现了意外且未处理的异常。 
    解决方法:请联系支持团队:support@zohocrm.com。

示例响应

Copied{
    "territories": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "431581000000734117"
            },
            "message": "Given Territory Removed Successfully and its child Territories moved to the another territory",
            "status": "success"
        }
    ]
}