Geo/api_get_layers

api_get_layerstoken required

Returns user-defined geofence layers, paginated (200 first page, 50 thereafter) and optionally filtered by name.

POST/api— body field action.name = "api_get_layers"

Parameters

NameTypeRequiredDescription
layer_namestringoptionalSubstring filter against `layer_name`.e.g. LIPU
last_object_idnumberoptionalPagination cursor — send the `object_id` of the last row you received to fetch the next page. Omit it for the first page (200 rows); later pages return 50.e.g. 200
versionstringoptionalAPI version (currently only '1'). Accepted but ignored.e.g. 1
client_idnumberoptionalNarrow the result to one client within the session's own scope. Cannot widen it.e.g. 14952

Notes

First page is 200 rows; later pages 50. The response's `pagination.has_more` tells you whether another page exists — iterate on that rather than on the row count, because a full page is not by itself proof that more rows follow. `page_size` is accepted on the wire but ignored — the cursor is the only paging control, so any value sent is replaced with 200. Empty first page returns action_value '2' ('no_layers'). env_id and client_id come from the session.

Request

curl
curl -X POST 'https://private.stage.questar.io/v2/private-questar-units/api' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  --data '{"action":{"name":"api_get_layers","parameters":[{"layer_name":"LIPU","last_object_id":200,"version":"1","client_id":14952}]}}'
Body
{
  "action": {
    "name": "api_get_layers",
    "parameters": [
      {
        "layer_name": "LIPU",
        "last_object_id": 200,
        "version": "1",
        "client_id": 14952
      }
    ]
  }
}

Response

Successful responses always wrap the action's payload in response.properties. The action_value field reports the handler outcome: "0" for success, "1" for invalid params, "2" for not allowed, "3" for limit-exceeded /pagination-session-expired, "999" for general error.

200 OK
{
  "response": {
    "properties": {
      "action_name": "api_get_layers",
      "action_value": "0",
      "description": "success",
      "data": [
        {
          "object_id": "1",
          "layer_id": "501",
          "layer_name": "Depot Geofences",
          "count_geometries_in_layer": "12",
          "created_date": "2025-09-10T12:00:00",
          "created_by": "haim.lati",
          "last_updated_date": "2025-12-01T08:00:00",
          "color_id": "3",
          "icon_id": "17"
        }
      ]
    }
  }
}