Record your decision on one request (user)
Approve or reject one request, whatever its kind.
One route for all three kinds, where v1 has a separate endpoint per type with a different body for each. The engine underneath is unchanged, so a decision taken here settles exactly as one taken on v1 does - including any single rejection ending the request outright, from any step.
The response carries the request's status and progress after the decision, so a client can redraw the row without a second call, and can tell "recorded, still waiting on others" from "that settled it" - which a bare 201 cannot say.
Refusals are distinguished on purpose:
- 403 you are not among the people this request asks to decide it.
- 409 with a step message: the request has not reached your step yet. Matches the
can_decide_now: falsethe queues report for that row. - 409 with a pending message: you already answered, or somebody settled it first. A race lost honestly, not a permissions problem.
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>
absences home-office time-point-corrections application/jsonRequest body · required · application/json
accepted rejectedacceptedFine by meResponses
absences home-office time-point-correctionsabsences550e8400-e29b-41d4-a716-446655440010pendingprogress*object | null
Team lead31waiting_on*array<object>
550e8400-e29b-41d4-a716-446655440031Muller Jonasapproved_by*array<object>
550e8400-e29b-41d4-a716-446655440030Lemaire Faridnext_stepobject | null
HR2steps*array<object>
1Team leadpending active completed bypassed rejectedcompletedApproved by Lemaire Farid11validatorsarray<object>
550e8400-e29b-41d4-a716-446655440030Lemaire Faridpending accepted rejectedacceptedsupervisors*array<object>
550e8400-e29b-41d4-a716-446655440032Weber Inespending accepted rejectedpending1Authorization Token is missingThe given data was invalid.errorsobject
filterarray<string>
sortarray<string>
pagearray<string>
per_pagearray<string>
https://cockpit.voxbi.com/api/v1/v2/{pbx}/requests/{kind}/{id}/decision
curl -X POST 'https://cockpit.voxbi.com/api/v1/v2/{pbx}/requests/{kind}/{id}/decision' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/v2/{pbx}/requests/{kind}/{id}/decision', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://cockpit.voxbi.com/api/v1/v2/{pbx}/requests/{kind}/{id}/decision',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/v2/{pbx}/requests/{kind}/{id}/decision', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057{ … }
"errors": { … }
"filter": [ … ],
"sort": [ … ],
"page": [ … ],
"per_page": [ … ]
private, must-revalidatekeep-aliveapplication/jsonOrigin6057