Projects
List child projects with device counts
List child projects with device counts using Ovok’s Slim API.
| Method | Path |
|---|---|
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(nullwhen there is none) and every direct child inchildProjects. Grandchildren and children whose project no longer exists are left out. - Every project also carries
deviceCount: the number ofDeviceresources in that project. settings.timeZonedefaults toEurope/Berlin;settings.trendsPerioddefaults tostart: "09:00:00"anddurationSeconds: 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 } }
}
]
}| Field | Type | Description |
|---|---|---|
currentProject | object | null | The caller's project. |
parentProject | object | null | The project the caller's project is a child of. null when it has none. |
childProjects | object[] | Every direct child project. Empty array when there are none. |
Each project, in currentProject, parentProject and childProjects, has these fields:
| Field | Type | Description |
|---|---|---|
resourceType | "Project" | Always Project. |
id | string (uuid) | Project id. |
name | string | Project name. The project id when the project has no name. |
deviceCount | integer | Number of Device resources in the project. |
address | object[] | 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. |
contact | object[] | Contact persons of the project. Left out when there are none. Each entry has the fields telecom, name and address. |
settings | object | Project settings. |
settings.timeZone | string | Time zone name. Europe/Berlin when none is stored. |
settings.trendsPeriod | object | The daily window that trends cover. |
settings.trendsPeriod.start | string | Start time as HH:MM:SS. 09:00:00 when none is stored. |
settings.trendsPeriod.durationSeconds | number | Length of the window in seconds. 86400 when none is stored. |
Errors
Last updated on