Locations

List locations in a project (admin)

List locations in a project (admin) using Ovok’s Slim API.

MethodPath
GET/v1/slim/location/admin/list

Authentication · Access policies

Lists the locations of a given project. The admin dashboard uses it to fill the location picker after you choose a project.

Auth: Bearer token. The caller must be a project admin. Super admins without the admin role, practitioners and System Owner callers are refused. The access-policy check (Location:search, Location:read) is skipped for admins. Scope: The project named by the required projectId query parameter. The search runs with Ovok's admin client, not the caller's token.

Request

Query parameters

NameTypeRequiredDescription
projectIdstring (uuid)YesProject to list locations of.
pageintegerNoZero-based page number. Default 0, minimum 0.
countintegerNoRows per page. Default 50, minimum 1, maximum 100.

Behaviour

  • Read-only.
  • Locations are sorted by name.
  • Pagination is zero-based: page (default 0) and count (default 50, max 100).
  • total is an estimate: when a page is full it is one more than the rows seen so far, so a full page means more may follow.
  • Unlike GET /v1/slim/location, rows carry no device or resident fields: one row per location.

Example

curl -X GET 'https://api.sandbox.ovok.com/v1/slim/location/admin/list?projectId=b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68&page=0&count=50' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response

200 — Locations retrieved successfully.

{
  "total": 1,
  "page": 0,
  "count": 50,
  "resources": [
    {
      "id": "5d2a9c64-7e1b-4830-b6f5-9a3c1e8d7b02",
      "name": "Room 18",
      "floor": "2",
      "room": "18",
      "organizationId": "1e6b8d30-2c4f-4a95-8d7e-b0a2c4e6f918",
      "organizationName": "Zone A"
    }
  ]
}
FieldTypeDescription
totalintegerEstimated total. When the page is full, one more than the rows seen so far.
pageintegerPage number of this response.
countintegerPage size of this response.
resourcesobject[]The rows of this page, sorted by name.
resources[].idstring (uuid)Location id.
resources[].namestringLocation name. Empty string when it has none.
resources[].floorstringFloor code. Left out when not set.
resources[].roomstringRoom code. Left out when not set.
resources[].bedstringBed code. Left out when not set.
resources[].organizationIdstring (uuid)Zone id. Left out when the location has no zone.
resources[].organizationNamestringZone name. Left out when the location has no zone.

Errors

StatusMeaning
401Bearer token is missing, invalid or expired.
403You are not a project admin.
422A query parameter fails validation.

Last updated on

On this page