List weekly work times for a single employee (user)
Returns the weekly work-time aggregates for one employee. The response is a flat object (NOT wrapped in data) 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. Each entry also includes a minWorkTimeReached boolean. The caller may only request their 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
Authorization Token is missingmessagearray<string>
The given data was invalid.errorsobject
filterarray<string>
sortarray<string>
pagearray<string>
per_pagearray<string>
https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/work-times
curl -X GET 'https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_id}/work-times' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/{pbx_id}/user/{employee_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}/user/{employee_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}/user/{employee_id}/work-times', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"2024-03-04": { … },
"2024-03-11": { … },
"summary": { … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"message": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"errors": { … }
"filter": [ … ],
"sort": [ … ],
"page": [ … ],
"per_page": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057