Get all territories

get

/crmRestApi/resources/11.13.18.05/territories

Request

Query Parameters
  • 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
  • Used as a predefined finder to search the collection.

    Format: ?finder=<finderName>;<variableName>=<variableValue>,<variableName2>=<variableValue2>

    The following are the available finder names and corresponding finder variables:

    • ActiveTerritoriesFinder: Finds all territories that are active as on the date specified by BindSysEffectiveDate variable.
      Finder Variables:
      • BindSysEffectiveDate; string; This bind variable is populated automatically from a date effective entity object. Do not enter any value for this bind variable.
    • PrimaryKey: Finds the territory by the specified primary key.
      Finder Variables:
      • TerritoryVersionId; integer; The unique identifier of the territory version.
    • UniqueTerritoryNumberFinder: Finds all territories that have the value specified in the UniqueTerritoryNumber variable.
      Finder Variables:
      • UniqueTerritoryNumber; string; The unique territory number of the territory.
  • This parameter restricts the number of resources returned inside the resource collection. If the limit exceeds the resource count then the framework will only return the available resources.
  • 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
  • Used to define the starting position of the resource collection. If offset exceeds the resource count then no resources are returned. Default value is 0.
  • The resource item payload will be filtered in order to contain only data (no links section, for example).
  • This parameter orders a resource collection based on the specified fields. The parameter value is a comma-separated string of attribute names, each optionally followed by a colon and "asc" or "desc". Specify "asc" for ascending and "desc" for descending. The default value is "asc". For example, ?orderBy=field1:asc,field2:desc
  • This query parameter defines the where clause. The resource collection will be queried using the provided expressions. The value of this query parameter is one or more expressions. Example: ?q=Deptno>=10 and <= 30;Loc!=NY

    Format: ?q=expression1;expression2

    You can use these queryable attributes to filter this collection resource using the q query parameter:
    • CoverageModel; string; Indicates if the dimensions of the territory are based on account attributes or partner attributes.
    • CreatedBy; string; The user who created the territory.
    • CreationDate; string; The date the territory was created.
    • Description; string; The description of the territory.
    • EffectiveEndDate; string; The date and time when the territory version becomes inactive.
    • EffectiveStartDate; string; 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.
    • EligibleForQuotaFlag; boolean; 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.
    • ForecastParticipationCode; string; The code for the forecast participation. The accepted values are: REVENUE, NONREVENUE, REVENUE_AND_NONREVENUE, and NON_FORECASTING.
    • ForecastedByParentTerritoryFlag; boolean; Indicates if the forecast for the territory is made by its parent territory. The default value is false.
    • LastUpdateDate; string; The date the territory was last updated.
    • LastUpdateLogin; string; The login of the user who last updated the territory.
    • LastUpdatedBy; string; The user who last updated the territory.
    • LatestVersionFlag; boolean; 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.
    • Name; string; The name of the territory.
    • Owner; string; The owner of the territory.
    • OwnerEmail; string; The email address of the owner.
    • OwnerResourceId; integer; The unique identifier of the owner resource.
    • OwnerResourceNumber; string; The registry ID of the owner.
    • ParentTerritoryId; integer; The unique identifier of the parent territory.
    • ParentTerritoryLovSwitcher; string; The field controls the display of parent territory list of values on the UI. This attribute is used for an internal purpose.
    • ParentTerritoryNumber; string; The number of the parent territory.
    • ParentUniqueTerritoryNumber; string; The unique territory number of the parent territory.
    • PartnerId; integer; The unique identifier of the partner associated with the territory.
    • PartnerName; string; The name of the partner associated with the territory.
    • PartnerNumber; string; The number of the partner.
    • PartnerProgramId; integer; The unique identifier of the partner program in which the partner is enrolled.
    • ProgramName; string; The name of the partner program to which the partner is enrolled.
    • ProposalNumber; string; The number of the proposal the territory is associated with.
    • ReviseQuotaFlag; boolean; Indicates whether a submitted quota needs to be revised.
    • RevisionDescription; string; The description of the reason for revising the quota.
    • RevisionReason; string; The user-defined reason for revising the quota.
    • SourceTerrId; integer; The unique identifier of the territory from which the dimensions are inherited.
    • SourceTerrLastUpdateDate; string; 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.
    • SourceTerrName; string; The name of the territory from which the selected dimensions are inherited.
    • SourceTerrVersionId; integer; The unique identifier of the source territory version.
    • SourceUniqueTerritoryNumber; string; The unique territory number of the source territory.
    • StatusCode; string; The code indicating the status of the territory. The accepted values are DRAFT and FINALIZED.
    • TerrProposalId; integer; The unique identifier of the territory proposal.
    • TerritoryFunctionCode; string; Business function associated with the territory
    • TerritoryHierarchyUniqueTerritoryNumber; string; The unique alternate identifier of the territory at the top of the hierarchy to be exported.
    • TerritoryId; integer; The unique identifier of the territory.
    • TerritoryLevel; integer; The level of the territory in the territory hierarchy.
    • TerritoryNumber; string; The unique alternate identification number for the territory.
    • TerritoryVersionId; integer; The unique identifier of the territory version.
    • TypeCode; string; The code indicating the type of the territory. For example, PRIME or OVERLAY.
    • UniqueTerritoryNumber; string; Unique identification number for this territory
  • The resource collection representation will include the "estimated row count" when "?totalResults=true", otherwise the count is not included. The default value is "false".
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
Type: object
Show Source
Nested Schema : Items
Type: array
Title: Items
The items in the collection.
Show Source
Nested 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 all territories by submitting a get request on the REST resource using cURL.

cURL Command

curl -u <username:password> \ -X https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/territories

Example of Response Body

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

{
items: [25]
 0:  
 {
   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
   ...
}

Back to Top