Child Territories of a Territory

Purpose

To retrieve the details of child territories of your territory.

Request Details

Request URL

{api-domain}/crm/{version}/settings/territories/{territoryid}/__child_territories

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope=ZohoCRM.settings.territories.{operation_type}

Possible operation types

ALL - Full access to territories data
READ - Read territories data

Parameters

  • filters
    Filters parameter can be used to retrieve the details of the child territory that you are searching for.
    eg:?filters={"field": {"api_name" : "manager.id"},"value":"431581000000278001" ,"comparator": "equal"}
    This can be used to find the territories whose manager is J Smith (whose user id is 431581000000278001 )
    Keys and comparators
    • Keys reporting_to.id, manager.id, id, permission_type, created_by, modified_by
      Comparators equal, not_equal
    • Key name
      Comparators equal, not_equal, ends_with, starts_with, contains, not_contains
    • Keys created_time, modified_time
      Comparators less_equal, between, greater_than, less_than, equal
  • pageinteger, optional

    To get the list of records from the respective pages. Default value for page is 1.
    Possible values: Positive Integer values only.

  • per_pageinteger, optional

    To get the list of records available per page. The default and the maximum possible value is 200.
    Possible values: Positive Integer values only.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v5/settings/territories/431581000000744159/__child_territories"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Response JSON Keys

  • created_timestring

    Represents the date and time at which the current territory was created.

  • managerJSON object

    Represents the name and ID of the current territory's manager.

  • account_rule_criteria JSON Object

    Represents the criteria for account module territory rules(comparator,field and value)

  • descriptionstring

    Represents the description of the territory, if any.

  • lead_rule_criteria JSON Object

    Represents the criteria for lead module territory rules(comparator,field and value)

  • reporting_tostring

    Represents the unique ID of the parent territory.

  • deal_rule_criteria JSON Object

    Represents the criteria for deal module territory rules(comparator,field and value)

  • permission_type string

    Represents the type of permission for the territory. Possible values are read_only and read_write_delete.

  • modified_timestring

    Represents the date and time at which the current territory was last modified.

  • namestring

    Represents the name of the territory.

  • modified_byJSON object

    Represents the name and ID of the user who last modified the current territory.

  • idstring

    Represents the unique ID of the territory.

Possible Errors

  • INVALID_REQUEST_METHODHTTP 400

    The http request method type is not a valid one
    Resolution: You have specified an invalid HTTP method to access the API URL. Specify a valid request method. Refer to endpoints section above.

  • AUTHORIZATION_FAILEDHTTP 400

    User does not have sufficient privilege to read territories
    Resolution: The user does not have the permission to retrieve territories data. Contact your system administrator.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: Client does not have ZohoCRM.settings.territories.READ scope. Create a new client with valid scope. Refer to scope section above.

  • NO_PERMISSIONHTTP 403

    Permission denied to read
    Resolution: The user does not have permission to read territories data. Contact your system administrator.

  • INVALID_URL_PATTERNHTTP 404

    Please check if the URL trying to access is a correct one
    Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to request URL section above.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in Server. Contact support team.

Sample Response

Copied       {
    "territories": [
        {
            "created_time": "2023-06-10T12:28:06+05:30",
            "manager": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "account_rule_criteria": {
                "comparator": "equal",
                "field": {
                    "api_name": "Industry",
                    "id": "431581000000000621"
                },
                "value": "Consulting"
            },
            "description": null,
            "lead_rule_criteria": null,
            "reporting_to": {
                "name": "Parent",
                "id": "431581000000744159"
            },
            "deal_rule_criteria": null,
            "created_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "permission_type": "read_only",
            "modified_time": "2023-06-10T12:28:31+05:30",
            "name": "Child",
            "modified_by": {
                "name": "Patricia Boyle",
                "id": "431581000000258001"
            },
            "id": "431581000000744169"
        }
    ],
    "info": {
        "per_page": 200,
        "count": 1,
        "page": 1,
        "more_records": false
    }
}