Projects

List child projects with device counts

List child projects with device counts using Ovok’s Slim API.

MethodPath
GET/v2/slim/project/child

Authentication · Access policies

Returns your current project together with its parent project and its direct child projects, each with its device count. Use it for a project switcher or hierarchy view that shows fleet size.

Auth: Bearer token for a practitioner, project admin or System Owner session. The caller's access policy must grant AccessPolicy:read (project admins skip this check). Scope: The caller's project (from the token).

Request

No parameters.

Behaviour

  • Same lists as GET /v1/slim/project/child: currentProject, parentProject (null when there is none) and every direct child in childProjects. Grandchildren and children whose project no longer exists are left out.
  • Every project also carries deviceCount: the number of Device resources in that project.
  • settings.timeZone defaults to Europe/Berlin; settings.trendsPeriod defaults to start: "09:00:00" and durationSeconds: 86400.

Example

curl -X GET 'https://api.sandbox.ovok.com/v2/slim/project/child' \
  -H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response

200 — Project relationships retrieved successfully.

{
  "currentProject": {
      "resourceType": "Project",
      "id": "b7a3d915-6e20-4c8f-9a14-3d5f7b9c1e68",
      "name": "Example project",
      "deviceCount": 14,
      "address": [{ "line": ["Hauptstrasse 1"], "city": "Berlin", "postalCode": "10115", "country": "DE" }],
      "settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
    },
  "parentProject": {
      "resourceType": "Project",
      "id": "c6e2a4f8-0b3d-4719-a5c7-9e1f3b5d7a20",
      "name": "Parent project",
      "deviceCount": 120,
      "settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
    },
  "childProjects": [
    {
        "resourceType": "Project",
        "id": "f0a2c4e6-8b1d-4357-9f9b-1d3e5a7c9b46",
        "name": "Child project",
        "deviceCount": 6,
        "settings": { "timeZone": "Europe/Berlin", "trendsPeriod": { "start": "09:00:00", "durationSeconds": 86400 } }
      }
  ]
}
FieldTypeDescription
currentProjectobject | nullThe caller's project.
parentProjectobject | nullThe project the caller's project is a child of. null when it has none.
childProjectsobject[]Every direct child project. Empty array when there are none.

Each project, in currentProject, parentProject and childProjects, has these fields:

FieldTypeDescription
resourceType"Project"Always Project.
idstring (uuid)Project id.
namestringProject name. The project id when the project has no name.
deviceCountintegerNumber of Device resources in the project.
addressobject[]Postal addresses of the project. Left out when there are none. Each entry has the fields use, type, text, line, city, district, state, postalCode and country.
contactobject[]Contact persons of the project. Left out when there are none. Each entry has the fields telecom, name and address.
settingsobjectProject settings.
settings.timeZonestringTime zone name. Europe/Berlin when none is stored.
settings.trendsPeriodobjectThe daily window that trends cover.
settings.trendsPeriod.startstringStart time as HH:MM:SS. 09:00:00 when none is stored.
settings.trendsPeriod.durationSecondsnumberLength of the window in seconds. 86400 when none is stored.

Errors

StatusMeaning
401The bearer token is missing or invalid, or the session carries no project.
403The session is not a practitioner, admin or System Owner session, or its access policy lacks AccessPolicy:read.

Last updated on

On this page