Territory Lookup REST Call (v3.13+)


Overview

The EasyTerritory Territory Lookup is a REST endpoint that provides information about the territories in your EasyTerritory project. For instance, a developer could make a query and retrieve information on a territory based on a ZIP/postal code or a specific point (latitude/longitude) that it falls in. 

There are a few setup steps that you’ll have to do to make this query.

Step 1: Build an EasyTerritory project containing territories using geographies such as ZIP/Postal Codes or State boundaries and set up the ProjectMarkupPlugin following these instructions.

Step 2: Follow these instructions to authenticate with EasyTerritory and receive an ‘oitoken’.

Step 3: Call the EasyTerritory Territory Lookup REST Call

GET Project Markup Returns all polygon markup for the project.

https://apps.easyterritory.com/{YourEZTInstanceGuid}/{YourEZTInstanceType [DEV], [TEST], or [APP]. Note APP = Production.}/REST/ProjectMarkupPolygon/{project id}

GET Territory from Geography Returns markup of type territory for this project where they are built from the supplied territory id. Example: ZIP Code 32309 returns the ‘Tallahassee Territory’.

https://apps.easyterritory.com/{YourEZTInstanceGuid}/{YourEZTInstanceType [DEV], [TEST], or [APP]. Note APP = Production.}/REST/ProjectMarkupPolygon/{project id}/territory?territoryId=/{territory id}

GET Territory from Latitude and Longitude Returns all markup for this project containing the supplied lat/lon.

https://apps.easyterritory.com/{YourEZTInstanceGuid}/{YourEZTInstanceType [DEV], [TEST], or [APP]. Note APP = Production.}/REST/ProjectMarkupPolygon/{project id}/location?lat=/{latitude of location}andlon=/{longitude of location}

Step 4: Response JSON

primaryKey PrimaryKey set on the SQL table.

wkt Well Known Text geometry of the territory shape. The projection is Popular Spherical Mercator.

projectId ProjectID of the EasyTerritory project used to populate the record.

markupId Unique identifier of the territory shape created in the project.

tag Concatenated label Group Name | Name defined in the EasyTerritory project.

metadataJson Comma separated list of geography name values used to create the territories.

col1 First column in the group/territory name defined in your project. The additional col(2-8) are populated by delimited by a pipe {|} separator in the tag.

col2 See col1 description.

col3 See col1 description.

col4 See col1 description.

col5 See col1 description.

col6 See col1 description.

col7 See col1 description.

col8 See col1 description.

Additional Parameters:
omitWkt=true Omits the geometry that outlines the territory.

omitMetadata=true Omits the geography that defines the territory.

For additional question about or support using these REST calls, please email: support@easyterritory.com