curl --request GET \
--url https://api.example.com/api/dashboard-admin/distribucion{
"500": {},
"status": "<string>",
"data": {
"por_tipo": [
{
"id_tipo": 123,
"nombre": "<string>",
"total": 123
}
],
"por_estado": [
{
"id_estado": 123,
"nombre": "<string>",
"total": 123
}
]
}
}Get request distribution statistics by type and status
curl --request GET \
--url https://api.example.com/api/dashboard-admin/distribucion{
"500": {},
"status": "<string>",
"data": {
"por_tipo": [
{
"id_tipo": 123,
"nombre": "<string>",
"total": 123
}
],
"por_estado": [
{
"id_estado": 123,
"nombre": "<string>",
"total": 123
}
]
}
}mes_actual - Current month only{
"status": "error",
"message": "Error al obtener distribución."
}
curl -X GET 'https://api.example.com/api/dashboard-admin/distribucion' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'
// Get all-time organization-wide distribution
const response = await fetch('https://api.example.com/api/dashboard-admin/distribucion', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
});
const distribution = await response.json();
// Display distribution by type
console.log('By Type:');
distribution.data.por_tipo.forEach(item => {
console.log(` ${item.nombre}: ${item.total}`);
});
// Display distribution by status
console.log('\nBy Status:');
distribution.data.por_estado.forEach(item => {
console.log(` ${item.nombre}: ${item.total}`);
});
import requests
# All-time organization distribution
url = 'https://api.example.com/api/dashboard-admin/distribucion'
headers = {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
data = response.json()['data']
print('Distribution by Type:')
for item in data['por_tipo']:
print(f" {item['nombre']}: {item['total']}")
print('\nDistribution by Status:')
for item in data['por_estado']:
print(f" {item['nombre']}: {item['total']}")
curl -X GET 'https://api.example.com/api/dashboard-admin/distribucion?rango=mes_actual&empleado_id=42' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'
// Get current month distribution for specific employee
const employeeId = 42;
const response = await fetch(
`https://api.example.com/api/dashboard-admin/distribucion?rango=mes_actual&empleado_id=${employeeId}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
}
);
const distribution = await response.json();
console.log('Current month distribution:', distribution.data);
import requests
# Current month employee distribution
employee_id = 42
url = 'https://api.example.com/api/dashboard-admin/distribucion'
params = {
'rango': 'mes_actual',
'empleado_id': employee_id
}
headers = {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(url, params=params, headers=headers)
data = response.json()['data']
print(f"Distribution for employee {employee_id} (current month):")
print(f"By type: {data['por_tipo']}")
print(f"By status: {data['por_estado']}")
{
"status": "success",
"data": {
"por_tipo": [
{
"id_tipo": 1,
"nombre": "Vacaciones",
"total": 245
},
{
"id_tipo": 2,
"nombre": "Permiso",
"total": 132
},
{
"id_tipo": 3,
"nombre": "Ausencia",
"total": 78
},
{
"id_tipo": 4,
"nombre": "Trabajo Exterior",
"total": 56
}
],
"por_estado": [
{
"id_estado": 1,
"nombre": "Pendiente",
"total": 23
},
{
"id_estado": 2,
"nombre": "Aprobada",
"total": 412
},
{
"id_estado": 3,
"nombre": "Rechazada",
"total": 45
},
{
"id_estado": 4,
"nombre": "Cancelada",
"total": 31
}
]
}
}
{
"status": "success",
"data": {
"por_tipo": [
{
"id_tipo": 1,
"nombre": "Vacaciones",
"total": 1
},
{
"id_tipo": 2,
"nombre": "Permiso",
"total": 2
}
],
"por_estado": [
{
"id_estado": 1,
"nombre": "Pendiente",
"total": 1
},
{
"id_estado": 2,
"nombre": "Aprobada",
"total": 2
}
]
}
}
por_tipo data to create a pie chart showing the composition of request typespor_estado data to create a bar chart showing approval rates and pending volumes