Get a territory

get

/crmRestApi/resources/11.13.18.05/territories/{TerritoryVersionId}

Request

Path Parameters
Query Parameters
  • This parameter specifies dependencies which are fields that are set before and rolled back after generating the response. Generally they are used to preview the effects of an attribute change. The fields specified in this parameter are always set in the resource instance in question. When a child resource collection is requested and the parameter is set, the fields will be set in the parent resource instance before generating the resource collection payload. The value of this query parameter is a set of dependency fields. Example: dependency=ProductId=2

    Format: <attr1>=<val1>,<attr2>=<value2>
  • When this parameter is provided, the specified children are included in the resource payload (instead of just a link). The value of this query parameter is "all" or "". More than one child can be specified using comma as a separator. Example: ?expand=Employees,Localizations. Nested children can also be provided following the format "Child.NestedChild" (Example: ?expand=Employees.Managers). If a nested child is provided (Example: Employees.Managers), the missing children will be processed implicitly. For example, "?expand=Employees.Managers" is the same as "?expand=Employees,Employees.Managers" (which will expand Employees and Managers).
  • This parameter filters the resource fields. Only the specified fields are returned, which means that if no fields are specified, no fields are returned (useful to get only the links). If an indirect child resource is provided (Example: Employees.Managers), the missing children will be processed implicitly. For example, "?fields=Employees.Managers:Empname" is the same as "?fields=;Employees:;Employees.Managers:Empname" (which will only return the "Empname" field for Managers). the value of this query parameter is a list of resource fields. The attribute can be a direct (Example: Employees) or indirect (Example: Employees.Managers) child. It cannot be combined with expand query parameter. If both are provided, only fields will be considered.

    Format: ?fields=Attribute1,Attribute2

    Format for fields in child resource: ?fields=Accessor1:Attribute1,Attribute2
  • This parameter can be used to show only certain links while accessing a singular resource or a resource collection. The parameter value format is a comma-separated list of : <link_relation>

    Example:
    self,canonical
  • The resource item payload will be filtered in order to contain only data (no links section, for example).
Header Parameters
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.

There's no request body for this operation.

Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Headers
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Body ()
Root Schema : territories-item-response
Type: object
Show Source
  • Title: Coverage
    Maximum Length: 30
    Default Value: SALES_ACCOUNT_CENTRIC
    Indicates if the dimensions of the territory are based on account attributes or partner attributes.
  • Title: Created By
    Read Only: true
    Maximum Length: 64
    The user who created the territory.
  • Title: Creation Date
    Read Only: true
    The date the territory was created.
  • Read Only: true
    Indicates if the logged-in user can delete the territory.
  • Title: Description
    Maximum Length: 240
    The description of the territory.
  • Title: Effective End Date
    The date and time when the territory version becomes inactive.
  • Title: Effective Start Date
    The date and time when the territory version becomes active. If the StatusCode is DRAFT, then this value should be empty. Else, if the StatusCode is FINALIZED, then this value should be today's date.
  • Title: Eligible for Quota
    Maximum Length: 1
    Default Value: false
    Indicates whether the territory is going to change during a territory realignment. If the value is True, then the territory is unlikely to change during a major realignment, and therefore a quota can be entered against the proposed definition. The default value is true.
  • Title: Forecast Invisible to Owner
    Maximum Length: 1
    Default Value: false
    Indicates if the forecast for the territory is made by its parent territory. The default value is false.
  • Title: Enable Forecasting
    Maximum Length: 30
    Default Value: REVENUE
    The code for the forecast participation. The accepted values are: REVENUE, NONREVENUE, REVENUE_AND_NONREVENUE, and NON_FORECASTING.
  • Title: Last Updated Date
    Read Only: true
    The date the territory was last updated.
  • Title: Last Updated By
    Read Only: true
    Maximum Length: 64
    The user who last updated the territory.
  • Title: Last Update Login
    Read Only: true
    Maximum Length: 32
    The login of the user who last updated the territory.
  • Title: Latest Version
    Maximum Length: 1
    Default Value: true
    Indicates whether the territory is the latest active version. If the value is True, then the territory version is the latest active version of the territory.
  • Links
  • Title: Territory Name
    Maximum Length: 60
    The name of the territory.
  • Title: Organization
    Read Only: true
    The name of the organization to which the owner belongs.
  • Title: Owner
    Maximum Length: 360
    The owner of the territory.
  • Title: Owner Email
    Read Only: true
    Maximum Length: 320
    The email address of the owner.
  • Title: Resource ID
    The unique identifier of the owner resource.
  • Title: Owner Registry ID
    Read Only: true
    Maximum Length: 30
    The registry ID of the owner.
  • Title: Owner
    Maximum Length: 255
    The name of the owner.
  • Title: Parent Territory ID
    The unique identifier of the parent territory.
  • The field controls the display of parent territory list of values on the UI. This attribute is used for an internal purpose.
  • Title: Parent Territory Number
    Read Only: true
    Maximum Length: 30
    The number of the parent territory.
  • The name of the parent territory.
  • Title: Parent Territory Unique Number
    Maximum Length: 30
    The unique territory number of the parent territory.
  • Title: Partner ID
    The unique identifier of the partner associated with the territory.
  • Title: Partner
    Maximum Length: 360
    The name of the partner associated with the territory.
  • Title: Partner Number
    Maximum Length: 30
    The number of the partner.
  • Title: Partner Program ID
    The unique identifier of the partner program in which the partner is enrolled.
  • Title: Partner Program
    Maximum Length: 150
    The name of the partner program to which the partner is enrolled.
  • Title: Proposal Number
    Maximum Length: 30
    The number of the proposal the territory is associated with.
  • Title: Revise Quota
    Maximum Length: 1
    Indicates whether a submitted quota needs to be revised.
  • Title: Revision Description
    Maximum Length: 1000
    The description of the reason for revising the quota.
  • Title: Revision Reason
    Maximum Length: 30
    The user-defined reason for revising the quota.
  • Title: Source Territory ID
    The unique identifier of the territory from which the dimensions are inherited.
  • Title: Source Territory Last Update Date
    The date and time when the source territory was last updated. This attribute is related to the inheritance of dimensions by recipient territories from source territories.
  • Title: Source Territory
    Maximum Length: 60
    The name of the territory from which the selected dimensions are inherited.
  • Title: Source Territory Version ID
    The unique identifier of the source territory version.
  • Title: Source Unique Territory Number
    Maximum Length: 30
    The unique territory number of the source territory.
  • Title: Status
    Maximum Length: 30
    Default Value: DRAFT
    The code indicating the status of the territory. The accepted values are DRAFT and FINALIZED.
  • Title: Territory Function
    Maximum Length: 30
    Business function associated with the territory
  • Title: Territory Hierarchy Unique Territory Number
    Read Only: true
    Maximum Length: 30
    The unique alternate identifier of the territory at the top of the hierarchy to be exported.
  • Title: Territory ID
    The unique identifier of the territory.
  • Title: Territory Level
    The level of the territory in the territory hierarchy.
  • Line of Business
    Title: Line of Business
    The line of business resource is used to view the lines of business associated with a sales territory. A line of business is a general term that describes the products or services offered by the company or organization. The line of business object contains all lines of business for historical, active, and draft territory versions. It is optional for a sales territory to have associated lines of business.
  • Title: Territory Number
    Maximum Length: 30
    The unique alternate identification number for the territory.
  • Resources
    Title: Resources
    The resources resource is used to view the resources, such as owner or sales people associated with a sales territory. The equivalent functional term for resource is team member. The resources object contains all team members for historical, active, and draft territory versions. Each sales territory must have an owner, so each of the sales territory versions has at least one resource record.
  • Rules
    Title: Rules
    The rules resource is used to view the territory rules associated with a sales territory. The equivalent functional term for rule is coverage. The coverage is what identifies the scope of responsibility of the sales territory team in the market space. The rules object contains a record for each of the coverage for historical, active, and draft territory versions. A territory version may or may not have a coverage associated with it.
  • Title: Territory Version ID
    The unique identifier of the territory version.
  • Title: Territory Proposal ID
    The unique identifier of the territory proposal.
  • Title: Type
    Maximum Length: 30
    Default Value: PRIME
    The code indicating the type of the territory. For example, PRIME or OVERLAY.
  • Title: Unique Territory Number
    Maximum Length: 30
    Unique identification number for this territory
  • Read Only: true
    Indicates if the logged-in user can update the territory.
Nested Schema : Line of Business
Type: array
Title: Line of Business
The line of business resource is used to view the lines of business associated with a sales territory. A line of business is a general term that describes the products or services offered by the company or organization. The line of business object contains all lines of business for historical, active, and draft territory versions. It is optional for a sales territory to have associated lines of business.
Show Source
Nested Schema : Resources
Type: array
Title: Resources
The resources resource is used to view the resources, such as owner or sales people associated with a sales territory. The equivalent functional term for resource is team member. The resources object contains all team members for historical, active, and draft territory versions. Each sales territory must have an owner, so each of the sales territory versions has at least one resource record.
Show Source
Nested Schema : Rules
Type: array
Title: Rules
The rules resource is used to view the territory rules associated with a sales territory. The equivalent functional term for rule is coverage. The coverage is what identifies the scope of responsibility of the sales territory team in the market space. The rules object contains a record for each of the coverage for historical, active, and draft territory versions. A territory version may or may not have a coverage associated with it.
Show Source
Nested Schema : territories-TerritoryLineOfBusiness-item-response
Type: object
Show Source
Nested Schema : territories-TerritoryResource-item-response
Type: object
Show Source
Nested Schema : territories-TerritoryRule-item-response
Type: object
Show Source
  • Title: Created By
    Read Only: true
    Maximum Length: 255
    The user who created the territory rule.
  • Title: Creation Date
    Read Only: true
    The date the territory rule was created.
  • Title: Last Updated Date
    Read Only: true
    The date the territory rule was last updated.
  • Title: Last Updated By
    Read Only: true
    Maximum Length: 255
    The user who last updated the territory rule.
  • Title: Last Update Login
    Read Only: true
    Maximum Length: 255
    The login of the user who last updated the territory rule.
  • Links
  • Title: Coverage Number
    The coverage number for the territory.
  • Title: Customer Coverage Code
    Maximum Length: 30
    Default Value: INCLUSION
    The code for identifying whether the coverage adds to or removes from the territory's jurisdiction. The accepted values are: EXCLUSION (for rule type EXCLUSION and PARTNER_EXCLUSION) and INCLUSION (for all other rule types, such as REGULAR, INCLUSION, PARTNER_REGULAR, PARTNER_INCLUSION, and INHERITANCE_OVERRIDE).
  • Title: Coverage
    Maximum Length: 30
    Default Value: REGULAR
    The code for the territory coverage type. If the territory coverage model is sales account centric, the accepted values are: -REGULAR (for coverage based on sales account dimensionality or named accounts) -INCLUSION (for manually included account coverage) -EXCLUSION (for manually excluded account coverage) If the territory coverage model is partner centric, the accepted values are: -PARTNER_REGULAR (for coverage based on partner dimensionality) -PARTNER_INCLUSION (for manually included partner coverage) -PARTNER_EXCLUSION (for manually excluded partner coverage) In case of inheritance, if the coverage is for a recipient territory, then the accepted value is INHERITANCE_OVERRIDE which indicates that the coverage overrides some of the inherited dimensionality.
  • Rule Boundaries
    Title: Rule Boundaries
    The rule boundaries resource is used to view the rule boundaries associated with a sales territory. The equivalent functional term for rule boundary is coverage dimension. The rule boundaries object contains records for each of the dimensions defined for a given territory coverage.
  • Title: Territory Number
    The unique identifier of the territory version.
  • Title: Coverage ID
    The unique identifier of the territory rule.
Nested Schema : Rule Boundaries
Type: array
Title: Rule Boundaries
The rule boundaries resource is used to view the rule boundaries associated with a sales territory. The equivalent functional term for rule boundary is coverage dimension. The rule boundaries object contains records for each of the dimensions defined for a given territory coverage.
Show Source
Nested Schema : territories-TerritoryRule-TerritoryRuleBoundary1-item-response
Type: object
Show Source
Nested Schema : Rule Boundary Values
Type: array
Title: Rule Boundary Values
The rule boundary values resource is used to view the rule boundary values associated with a sales territory. The equivalent functional term for rule boundary value is coverage dimension member. The rule boundary values object contains records for the dimension members for each coverage dimension.
Show Source
Nested Schema : territories-TerritoryRule-TerritoryRuleBoundary1-TerritoryRuleBndryValue1-item-response
Type: object
Show Source
Back to Top

Examples

The following example shows how to get a territory by submitting a get request on the REST resource using cURL.

cURL Command

curl --user sales_cloud_user https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/territories/100000015312131

Example of Response Body

The following shows an example of the response body in JSON format.

{
  EffectiveEndDate: "4713-01-31"
  EffectiveStartDate: "2010-01-13"
  Name: "APAC Sales QA Organization Type"
  TerritoryVersionId: 100000015312131
  OwnerResourceId: 100010032635399
  ParentTerritoryId: 100000015312038
  StatusCode: "FINALIZED"
  TerrProposalId: 100000015312024
  TerritoryId: 100000015312130
  TerritoryLevel: 3
  TypeCode: "PRIME"
  LatestVersionFlag: true
  ...
}

Note:

You can use any number of coverages for a territory. However, it is recommended that you limit the number of records per query to tens of thousands. For example, a query to get 50000 records can be curl -u <username:password> \ -X https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/territories?limit=50000. Additionally, you can configure an appropriate gateway timeout in your client application when querying tens of thousands of territory coverage records.
Back to Top