Crear horario
curl --request POST \
--url https://api.filexpress.app/api/external/hr/work-schedules \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Nocturno",
"code": "NOCHE",
"description": "Vigilancia",
"color": "#2f54eb",
"shifts": [
{
"weekday": 1,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 2,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 3,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Nocturno',
code: 'NOCHE',
description: 'Vigilancia',
color: '#2f54eb',
shifts: [
{weekday: 1, start_time: '22:00', end_time: '05:00', break_minutes: 0},
{weekday: 2, start_time: '22:00', end_time: '05:00', break_minutes: 0},
{weekday: 3, start_time: '22:00', end_time: '05:00', break_minutes: 0}
]
})
};
fetch('https://api.filexpress.app/api/external/hr/work-schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/hr/work-schedules"
payload = {
"name": "Nocturno",
"code": "NOCHE",
"description": "Vigilancia",
"color": "#2f54eb",
"shifts": [
{
"weekday": 1,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 2,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 3,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/hr/work-schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Nocturno',
'code' => 'NOCHE',
'description' => 'Vigilancia',
'color' => '#2f54eb',
'shifts' => [
[
'weekday' => 1,
'start_time' => '22:00',
'end_time' => '05:00',
'break_minutes' => 0
],
[
'weekday' => 2,
'start_time' => '22:00',
'end_time' => '05:00',
'break_minutes' => 0
],
[
'weekday' => 3,
'start_time' => '22:00',
'end_time' => '05:00',
'break_minutes' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"business_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Administrativo",
"code": "ADM",
"description": "Lunes a viernes",
"color": "#1890ff",
"is_active": true,
"shifts": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"weekday": 1,
"start_time": "08:00",
"end_time": "17:00",
"break_minutes": 60,
"break_paid": null
}
],
"weekly_minutes": 2400,
"days": [
{
"weekday": 1,
"minutes": 480,
"shift_kind": "day",
"warnings": []
},
{
"weekday": 7,
"minutes": 0,
"shift_kind": null,
"warnings": []
}
],
"warnings": []
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"message": "Validation errors",
"errors": {
"start_date": [
"The start date field is required."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}Crear horario
Crea un horario. Un turno con salida menor o igual que la entrada termina al día siguiente. Los turnos de un día no pueden solaparse.
Permiso requerido: hr.schedules.write
POST
/
hr
/
work-schedules
Crear horario
curl --request POST \
--url https://api.filexpress.app/api/external/hr/work-schedules \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Nocturno",
"code": "NOCHE",
"description": "Vigilancia",
"color": "#2f54eb",
"shifts": [
{
"weekday": 1,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 2,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 3,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
}
]
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Nocturno',
code: 'NOCHE',
description: 'Vigilancia',
color: '#2f54eb',
shifts: [
{weekday: 1, start_time: '22:00', end_time: '05:00', break_minutes: 0},
{weekday: 2, start_time: '22:00', end_time: '05:00', break_minutes: 0},
{weekday: 3, start_time: '22:00', end_time: '05:00', break_minutes: 0}
]
})
};
fetch('https://api.filexpress.app/api/external/hr/work-schedules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/hr/work-schedules"
payload = {
"name": "Nocturno",
"code": "NOCHE",
"description": "Vigilancia",
"color": "#2f54eb",
"shifts": [
{
"weekday": 1,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 2,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
},
{
"weekday": 3,
"start_time": "22:00",
"end_time": "05:00",
"break_minutes": 0
}
]
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/hr/work-schedules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Nocturno',
'code' => 'NOCHE',
'description' => 'Vigilancia',
'color' => '#2f54eb',
'shifts' => [
[
'weekday' => 1,
'start_time' => '22:00',
'end_time' => '05:00',
'break_minutes' => 0
],
[
'weekday' => 2,
'start_time' => '22:00',
'end_time' => '05:00',
'break_minutes' => 0
],
[
'weekday' => 3,
'start_time' => '22:00',
'end_time' => '05:00',
'break_minutes' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"business_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Administrativo",
"code": "ADM",
"description": "Lunes a viernes",
"color": "#1890ff",
"is_active": true,
"shifts": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"weekday": 1,
"start_time": "08:00",
"end_time": "17:00",
"break_minutes": 60,
"break_paid": null
}
],
"weekly_minutes": 2400,
"days": [
{
"weekday": 1,
"minutes": 480,
"shift_kind": "day",
"warnings": []
},
{
"weekday": 7,
"minutes": 0,
"shift_kind": null,
"warnings": []
}
],
"warnings": []
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"message": "Validation errors",
"errors": {
"start_date": [
"The start date field is required."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}Authorizations
API Key de la integración (Integraciones → Nueva Integración).
Body
application/json
Response
Horario creado