List weekly work times for employees in the tenant (user)
Returns a paginated map of weekly work-time aggregates for active employees in the PBX tenant. The response uses a hand-rolled Laravel paginator envelope (data, links, meta). The data object is keyed by employee UUID; each value is a map keyed by ISO week-start date (YYYY-MM-DD) plus a reserved summary key holding the totals across the queried range. Time values are formatted strings (HH:MM:SS) or - when no work shift was compiled for that week, and every one is mirrored by a signed <field>Seconds integer. Overtime figures are balances: a week below the required time is negative, so the weekly rows always sum to summary. Days after today are excluded from the aggregates (they would otherwise book a full requirement against zero worked time), so a still-running overtime period reports the same balance as GET /{pbx_id}/user/{employee_id}/overtime. When the authenticated user cannot view other employees (no validator scope) and no filter[employee_id] or user_ids is supplied, the result is scoped to the caller's own employee record; requesting another employee returns 403. The queried date range defaults to the current month and cannot exceed 100 days.
User bearer token. Default authentication for customer-facing endpoints.
Obtain a token by calling POST /login with your credentials, then send it
on every subsequent request as Authorization: Bearer <token>. The token
inherits the permissions and PBX scope of the authenticated user.
- HTTP Authorization Scheme
bearer- Bearer format
Bearer <token>
application/jsonResponses
dataobject
linksobject
http://localhost/api/v1/resources?page=1http://localhost/api/v1/resources?page=1metaobject
111linksarray<object>
http://localhost/api/v1/resources?page=1first1http://localhost/api/v1/resources1511Authorization Token is missingThe given data was invalid.errorsobject
filterarray<string>
sortarray<string>
pagearray<string>
per_pagearray<string>
https://cockpit.voxbi.com/api/v1/{pbx_id}/work-times
curl -X GET 'https://cockpit.voxbi.com/api/v1/{pbx_id}/work-times' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/work-times', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://cockpit.voxbi.com/api/v1/{pbx_id}/work-times',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
'http' => [
'method' => 'GET',
'header' => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/{pbx_id}/work-times', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"data": { … },
"550e8400-e29b-41d4-a716-446655440001": { … }
"2024-03-04": { … },
"2024-03-11": { … },
"summary": { … }
"links": { … },
"meta": { … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"errors": { … }
"filter": [ … ],
"sort": [ … ],
"page": [ … ],
"per_page": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057