Location

Get Location List

This API retrieves a list of locations, including the location ID, location name, organization ID, coordinates, and timezone. You can also filter the results by specifying an organization ID.

Endpoint: GET /locations

Query Parameters:

ParameterDescriptionTypeRequiredDefault

organization_id

Filter the locations based on organization ID.

integer

No

-

offset

The offset for pagination.

integer

No

0

limit

The maximum number of locations returned.

integer

No

100

Example Request:

GET /locations?organization_id=1&offset=0&limit=10

Example Response:

[
    {
      "id": 1,
      "name": "Location 1",
      "timezone": "America/New_York",
      "organization_id": 1,
      "coordinates": {
        "latitude": 40.712776,
        "longitude": -74.005974
      }
    },
    {
      "id": 2,
      "name": "Location 2",
      "timezone": "America/Los_Angeles",
      "organization_id": 1
      "coordinates": {
        "latitude": 37.774929,
        "longitude": -122.419418
      }
    }
]

Response Fields:

Field

Description

Type

id

The unique identifier for the location.

integer

name

The name of the location.

string

timezone

The timezone of the location.

string

organization_id

The ID of the organization the location belongs to.

integer

coordinates

The latitude and longitude of the location.

object


Get Location Details

This API retrieves the details of a specific location by location ID, including location name, organization ID, coordinates, timezone.

Endpoint: GET /locations/:location_id

Path Parameters:

ParameterDescriptionTypeRequire

location_id

The unique identifier for the location.

integer

Required

Example Request:

GET /locations/1

Example Response:

{
  "id": 1,
  "name": "Location 1",
  "timezone": "America/New_York",
  "organization_id": 1,
  "coordinates": {
    "latitude": 40.712776,
    "longitude": -74.005974
  }  
}

Response Fields:

FieldDescriptionType

id

The unique identifier for the location.

integer

name

The name of the location.

string

timezone

The timezone of the location.

string

organization_id

The ID of the organization the location belongs to.

integer

coordinates

The latitude and longitude of the location.

object