The EasyTerritory REST API allows developers to extend and integrate with their EasyTerritory applications.
Typical use cases include:
- Territory lookup based on postal code or latitude/longitude.
- Geocoding addresses into latitude/longitude for mapping interfaces.
Before calling any API endpoints, developers must authenticate to retrieve an OI Token.
If you want to use a service user for calling any API endpoints, the service user and password are configured in the administration panel of the Territory Designer application.
Login Endpoint
POST https://apps.www.easyterritory.com/{YourGuid}/{YourEZTInstanceType}/REST/Login/Login
Notes:
- {YourGuid} → Your EasyTerritory GUID.
- {YourEZTInstanceType} → One of [DEV], [TEST], or [APP] (APP = Production).
- {ProjectId} → The target EasyTerritory project.
Request Headers
- Media Types: “application/json”
Request Body
{
username:"[email protected]",
password:"Password"
}
| Field | Required | Type | Description |
|---|---|---|---|
| username | Yes | String | Username of user you would like to use for API requests. If you want to use a service user for calling any API endpoints, the service user and password are configured in the administration panel of the Territory Designer application. |
| password | Yes | String | Password. |
Response Body
{
changePwdOnNextLogin: boolean;
email: string;
firstName: string;
id: string;
isAdmin: boolean;
isCrmWriter: boolean;
isMobileOnly: boolean;
lastName: string;
password: string;
restToken: string;
token: string;
ttlMillis: number;
username: string;
}
| Field | Description |
|---|---|
| changePwdOnNextLogin | Indicates whether the user must change their password on the next login. |
| User’s email address. | |
| firstName | User’s first name. |
| id | Unique identifier for the user. |
| isAdmin | Indicates whether the user is an administrator. |
| isCrmWriter | Indicates whether the user has CRM write permissions. |
| isMobileOnly | Indicates whether the user account is restricted to mobile access. |
| lastName | User’s last name. |
| password | User’s password (typically returned only in specific admin contexts). |
| restToken | Used internally. |
| token | Token used for REST API authentication. |
| ttlMillis | Time-to-live for the token in milliseconds. |
| username | User’s login username. |
Sample Request
cURL
curl -X POST \
"https://apps.www.easyterritory.com/12345678-1234-1234-1234-123456789abc/APP/REST/Login/Login" \
-H "Content-Type: application/json" \
-d '{
"username": "[email protected]",
"password": "Password"
}'
Sample Response
JSON
{
"changePwdOnNextLogin": false,
"email": "[email protected]",
"firstName": "John",
"id": "4f9d8f1c-1b23-4a7d-9e6a-9c123example",
"isAdmin": false,
"isCrmWriter": true,
"isMobileOnly": false,
"lastName": "Doe",
"password": "",
"restToken": "abcdeabcdeabcdeabcdeabcde",
"token": "abcdeabcdeabcdeabcdeabcde",
"ttlMillis": 31536000000,
"username": "[email protected]"
}
Extract the token value — this will be required for subsequent API calls.
Next Steps
Set the token as a cookie in your requests to EasyTerritory REST endpoints.
- Same-domain access (browser JavaScript): You may call APIs directly.
- Cross-domain access: You must use a server-side proxy (ASP.NET Core endpoint or any other server-side service).