---
title: "Get locations by filters"
method: POST
path: "/GetFilteredLocations"
tags: ["Locations"]
---

# Get locations by filters

`POST /GetFilteredLocations`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/GetFilteredLocations`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/GetFilteredLocations/post.ts> (a function with typed inputs; its response is checked against the schema)

Returns locations based on the filters applied.
             By default closed locations are not included in the response. To include them, set the `IncludeClosedLocations` parameter to `true`.

## Request body

- ServiceChannelServicesMessagingLocationGetFilteredLocationsRequest: Request object to get locations.
  - `ProviderId` integer: Unique provider identifier.
  - `LocationIds` integer[]: Unique location identifier.
  - `Name` string: Location name.
  - `Address` string: Main location address.
  - `CountryId` integer: Numeric identifier of the location country.
  - `StateIds` integer[]: Numeric identifier of the location’s state.
  - `City` string: Location city.
  - `Region` string: Part of the country where the location is situated.
  - `District` string: Abbreviation of the town or country area where the location is situated.
  - `IncludeClosedLocations` boolean: Flag to include closed locations in the result.

## Response `200`

The filtered locations are in the response.

- ServiceChannelServicesMessagingLocationLocationShortModel[]
  - `Id` integer: Unique location identifier.
  - `StoreId` string: Alphanumeric identifier of the store in the client's system. Assigned by and unique per subscriber.
  - `Name` string: Location name.
  - `Address` string: Main location address.
  - `City` string: Location city.
  - `State` string: State where the location is situated.
  - `Zip` string: Location ZIP or postal code.
  - `Phone` string: Contact phone number of the location.
  - `Region` string: Part of the country where the location is situated.
  - `District` string: Abbreviation of the town or country area where the location is situated.
  - `StateId` integer: Numeric identifier of the location’s state.
  - `FullName` string
  - `AddressAddl` string
  - `StoreOpen` string, date-time
  - `StoreClose` string, date-time
  - `Latitude` number, double
  - `Longitude` number, double
  - `CountyId` integer
  - `County` string
  - `Status` string
  - `SubscriberId` integer
  - `SubscriberName` string

## Other responses

- `400`: The request is not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: 502 — Subscriber not found
- `401`: The request is not authorized. <br/>Error codes: 504 — API call rejected by security permissions
- `403`: You are not authorized to request this resource, or the resource is unavailable for some reason. <br/>Error codes: 100 — User has no rights to perform this action
- `500`: The server was unable to complete the request due to an internal error. <br/>Error codes: 501 — Object reference not set to an instance of an object

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
