curl --request GET \
--url https://api.example.com/api/dashboard-admin/tendencia{
"500": {},
"status": "<string>",
"data": [
{
"mes": "<string>",
"total": 123,
"fecha_orden": "<string>"
}
]
}Get historical request trends over time
curl --request GET \
--url https://api.example.com/api/dashboard-admin/tendencia{
"500": {},
"status": "<string>",
"data": [
{
"mes": "<string>",
"total": 123,
"fecha_orden": "<string>"
}
]
}{
"status": "error",
"message": "Error al obtener tendencia."
}
curl -X GET 'https://api.example.com/api/dashboard-admin/tendencia' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'
// Get last 6 months trend (organization-wide)
const response = await fetch('https://api.example.com/api/dashboard-admin/tendencia', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
});
const trends = await response.json();
// Display trend data
trends.data.forEach(month => {
console.log(`${month.mes}: ${month.total} requests`);
});
// Extract data for chart
const labels = trends.data.map(m => m.mes);
const values = trends.data.map(m => m.total);
console.log('Chart labels:', labels);
console.log('Chart values:', values);
import requests
import matplotlib.pyplot as plt
# Get last 6 months trend
url = 'https://api.example.com/api/dashboard-admin/tendencia'
headers = {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
data = response.json()['data']
# Display trend
for month in data:
print(f"{month['mes']}: {month['total']} requests")
# Plot trend chart
labels = [m['mes'] for m in data]
values = [m['total'] for m in data]
plt.figure(figsize=(10, 6))
plt.plot(labels, values, marker='o')
plt.title('Request Trends (Last 6 Months)')
plt.xlabel('Month')
plt.ylabel('Number of Requests')
plt.xticks(rotation=45)
plt.tight_layout()
plt.show()
curl -X GET 'https://api.example.com/api/dashboard-admin/tendencia?meses=12' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'
// Get last 12 months trend
const months = 12;
const response = await fetch(
`https://api.example.com/api/dashboard-admin/tendencia?meses=${months}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
}
);
const trends = await response.json();
console.log(`Trend data for last ${months} months:`, trends.data);
import requests
# Get last 12 months trend
url = 'https://api.example.com/api/dashboard-admin/tendencia'
params = {'meses': 12}
headers = {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
response = requests.get(url, params=params, headers=headers)
data = response.json()['data']
print(f"Trend data for last {params['meses']} months:")
for month in data:
print(f" {month['mes']}: {month['total']}")
curl -X GET 'https://api.example.com/api/dashboard-admin/tendencia?meses=6&empleado_id=42' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN'
// Get employee-specific trend
const employeeId = 42;
const response = await fetch(
`https://api.example.com/api/dashboard-admin/tendencia?meses=6&empleado_id=${employeeId}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN',
'Content-Type': 'application/json'
}
}
);
const trends = await response.json();
console.log(`Request trends for employee ${employeeId}:`, trends.data);
import requests
# Get employee-specific trend
employee_id = 42
url = 'https://api.example.com/api/dashboard-admin/tendencia'
params = {
'meses': 6,
'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"Trends for employee {employee_id}:")
for month in data:
print(f" {month['mes']}: {month['total']} requests")
{
"status": "success",
"data": [
{
"mes": "Oct 2025",
"total": 42,
"fecha_orden": "2025-10-01T00:00:00.000Z"
},
{
"mes": "Nov 2025",
"total": 38,
"fecha_orden": "2025-11-01T00:00:00.000Z"
},
{
"mes": "Dec 2025",
"total": 65,
"fecha_orden": "2025-12-01T00:00:00.000Z"
},
{
"mes": "Jan 2026",
"total": 28,
"fecha_orden": "2026-01-01T00:00:00.000Z"
},
{
"mes": "Feb 2026",
"total": 35,
"fecha_orden": "2026-02-01T00:00:00.000Z"
},
{
"mes": "Mar 2026",
"total": 18,
"fecha_orden": "2026-03-01T00:00:00.000Z"
}
]
}
{
"status": "success",
"data": [
{
"mes": "Oct 2025",
"total": 2,
"fecha_orden": "2025-10-05T00:00:00.000Z"
},
{
"mes": "Nov 2025",
"total": 1,
"fecha_orden": "2025-11-12T00:00:00.000Z"
},
{
"mes": "Dec 2025",
"total": 3,
"fecha_orden": "2025-12-02T00:00:00.000Z"
},
{
"mes": "Jan 2026",
"total": 1,
"fecha_orden": "2026-01-15T00:00:00.000Z"
},
{
"mes": "Feb 2026",
"total": 2,
"fecha_orden": "2026-02-08T00:00:00.000Z"
},
{
"mes": "Mar 2026",
"total": 1,
"fecha_orden": "2026-03-03T00:00:00.000Z"
}
]
}
fecha_orden field is used internally for sorting and typically not displayed to usersDATEADD function