Ir al contenido

Listar calendarios

GET/api/calendar

Devuelve la lista paginada de calendarios. Usa BaseControllerHelper::index. Los parámetros comunes (search, status, trashed, ids, fechas, per_page…) se describen en Paginación y filtros.

per_pageinteger

Registros por página. Por defecto 20.

searchstring

Texto a buscar en el nombre del calendario.

orderstring

Campo y sentido, por ejemplo name|ASC. Campos permitidos: id, name, description, status, created_at, updated_at. Por defecto id|DESC.

relationsstring

Relaciones a cargar, por ejemplo holiday.

No exige un permiso del módulo: CalendarPolicy::viewAny devuelve verdadero para cualquier usuario autenticado.

Ventana de terminal
curl -X GET \
"https://servererp.allendostmen.app/api/calendar" \
-H "Authorization: Bearer $TOKEN" \
-H "Accept: application/json"
Lista paginada200
{
"current_page": 1,
"data": [
{
"id": 1,
"holiday_id": 1,
"name": "CALENDARIO GENERAL",
"description": "Lunes a viernes de 8 a 17 horas",
"working_days": [
{
"day": 1,
"name": "Lunes",
"start_hour": "08:00:00",
"end_hour": "17:00:00",
"check": true
},
{
"day": 6,
"name": "Sábado",
"start_hour": "08:00:00",
"end_hour": "13:00:00",
"check": false
}
],
"default": true,
"status": "activo",
"previous_status": null,
"status_update_comment": null,
"status_update_date": null,
"status_update_user_id": null,
"create_user_id": 1,
"update_user_id": null,
"delete_user_id": null,
"restore_user_id": null,
"created_at": "2026-11-19T10:40:15.000000Z",
"updated_at": "2026-11-19T10:40:15.000000Z",
"deleted_at": null
}
],
"first_page_url": "https://servererp.allendostmen.app/api/calendar?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "https://servererp.allendostmen.app/api/calendar?page=1",
"next_page_url": null,
"path": "https://servererp.allendostmen.app/api/calendar",
"per_page": 20,
"prev_page_url": null,
"to": 1,
"total": 1
}
Sin permiso403
{
"message": "This action is unauthorized."
}