---
schema_version: "1"
id: 441147034bcc359faeae4e49619482f8a92a2b01cf3a8c021487e521fc702812
title: Get Service Territories
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/service-cloud/salesforce-scheduler-dev-guide/guides/salesforce-scheduler/uc6-get-service-territories.md
canonical_url: https://developer.salesforce.com/docs/service/salesforce-scheduler-dev-guide/guide/uc6-get-service-territories.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: fd5ac6525ffdbbb53db831f83ede04e2e631258a12ec61069a2a98b5ed65eee7
products:
  - Salesforce Scheduler Developer Guide
  - Service Cloud Developer Content
---

# Get Service Territories

Get a service territory based on the work type group that is selected in the previous step. A service territory represents a branch or office location where your service resources (appointment attendees) operate from or meet customers.

Create a page where you can provide users an option to search for service territories. Here’s how a Select Service Territory page can look.

![A representation of the Select Service Territory screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/concurrent-serviceTerritory.png)

Make a GET request on the [`service-territories`](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_service_territories.htm) Connect API by passing the user-entered search values and the selected work type group ID as the input parameters in the query string. You can also use a combination of the radius, latitude, longitude, sortBy, and sortOrder parameters to filter and sort the service territories.

**Resource URI**

```nolang
https://yourInstance.salesforce.com/services/data/vXX.X/connect/scheduling/service-territories
```

**Sample Request**

Here’s a sample GET request with the query string on the service territories Connect API.

```nolang
https://yourInstance.salesforce.com/services/data/vXX.X/connect/scheduling/service-territories
?workTypeGroupId=0VSB0000000TbhWOAS
```

**Sample Response**

The API returns the available service territories based on the passed work type group ID and search criteria.

```nolang

{
  "result" : {
    "serviceTerritories" : [ {
      "city" : "San Francisco",
      "country" : "United States",
      "id" : "0HhB00000001P0PKAU",
      "latitude" : 37.794928,
      "longitude" : -122.394514,
      "name" : "LSConcurrent Service Territory",
      "operatingHoursId" : "0OHB0000000LWkUOAW",
      "postalCode" : "90011",
      "state" : "CA",
      "street" : "2 Market Street"
    } ]
  }
}
```

Parse the JSON response, and show the available service territories on the Select Service Territory page so that the user can select a service territory.

Here’s a Select Service Territory page showing the available service territories.

![A representation of the Select Service Territory screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/concurrent-serviceTerritory1.png)

Here’s how the service territory details are displayed when the user selects a service territory.

![A representation of the Select Service Territory screen.](https://developer.salesforce.com/media/salesforce-scheduler-dev-guide/concurrent-serviceTerritory2.png)

After you get a work type group and service territory for the appointment, you must get a work type that is associated with both the work type group and service territory you have selected in the previous steps.

