Skip to main content

GET - List of locations

List of locations

Request

  • Method: GET
  • Endpoint: /locations
  • Base URL: https://api.targpatrol.com/api/v1
  • Operation ID: list-of-locations

Authorization

This endpoint requires an external API key.

x-api-key: {your_external_api_key}

Parameters

NameInRequiredSchemaDescription
limitquerynointegerinclude first N items of a resource collection
offsetquerynonumberexclude first N items of a resource collection
sortquerynostringsort items in a resource collection
qquerynostringThis parameter is used for quick search across text fields.
namequerynostringfilter by name
addressquerynostringfilter by address
withGraphicPlanquerynobooleanfilter by graphic plan existence
tagsquerynostringfilter by tags

Responses

200 OK

Content-Type: application/json Schema: object

Schema
{
"allOf": [
{
"$ref": "#/components/schemas/PageResponse"
},
{
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/LocationResponse"
}
}
}
}
]
}

Example: example-1

{
"data": [
{
"id": "638b90c5-7965-49ae-a02b-1b190cb216db",
"name": "W001",
"address": "Walmart 11,197",
"latitude": 51.0966229,
"longitude": -138.491986,
"tags": [
"tag1"
],
"graphicPlanIds": [
"3a1da1c9-0873-4bdc-b1f1-7343b29fdc27",
"14b8ec6b-8ee2-4533-aedd-b82691f19af2"
]
}
],
"meta": {
"offset": 0,
"limit": 20,
"count": 1000,
"sort": [
{
"property": "id",
"direction": "asc"
}
],
"filter": [
{
"property": "name",
"value": "W001"
}
]
}
}

401 Unauthorized

500 Internal Server Error

Content-Type: application/json Schema: ErrorResponse

Schema
{
"$ref": "#/components/schemas/ErrorResponse"
}

Example: example-1

{
"message": "internal server error",
"code": "internal.server.error",
"timestamp": "2023-03-07T05:57:59.315Z"
}