Skip to main content

Introduction

GIMA provides role-based dashboard endpoints that return contextual information based on the authenticated user’s role. These endpoints require authentication and appropriate role permissions.

Admin Dashboard

Access administrative dashboard with full system control.
GET /api/admin/dashboard
curl -X GET http://localhost:8000/api/admin/dashboard \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Accept: application/json"

Authorization

Authorization
string
required
Bearer token from login

Role Requirements

  • Required roles: admin

Response

mensaje
string
Welcome message for admin users
Example Response:
{
  "mensaje": "Hola Admin, tienes control total."
}

Status Codes

  • 200 - Success
  • 401 - Unauthorized (missing or invalid token)
  • 403 - Forbidden (user does not have admin role)

Technical Work Orders

View work orders and maintenance tasks for technical staff.
GET /api/tecnica/ordenes-trabajo
curl -X GET http://localhost:8000/api/tecnica/ordenes-trabajo \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Accept: application/json"

Authorization

Authorization
string
required
Bearer token from login

Role Requirements

  • Required roles: tecnico, supervisor, or admin

Response

mensaje
string
Work orders listing message
Example Response:
{
  "mensaje": "Listado de órdenes de trabajo (Visible para Técnico y Supervisor)"
}

Status Codes

  • 200 - Success
  • 401 - Unauthorized (missing or invalid token)
  • 403 - Forbidden (user does not have tecnico, supervisor, or admin role)

Supervision Audit

Access quality audit information for supervisors.
GET /api/supervision/auditoria
curl -X GET http://localhost:8000/api/supervision/auditoria \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Accept: application/json"

Authorization

Authorization
string
required
Bearer token from login

Role Requirements

  • Required roles: supervisor or admin

Response

mensaje
string
Audit access confirmation message
Example Response:
{
  "mensaje": "Auditoría de calidad (Solo Supervisor)"
}

Status Codes

  • 200 - Success
  • 401 - Unauthorized (missing or invalid token)
  • 403 - Forbidden (user does not have supervisor or admin role)

Monthly Reports

Access monthly reports and analytics.
GET /api/reportes/mensuales
curl -X GET http://localhost:8000/api/reportes/mensuales \
  -H "Authorization: Bearer YOUR_TOKEN_HERE" \
  -H "Accept: application/json"

Authorization

Authorization
string
required
Bearer token from login

Role Requirements

  • Required roles: reporter or admin

Response

mensaje
string
Reports access confirmation message
Example Response:
{
  "mensaje": "Descarga de excel/pdf (Solo Reporter)"
}

Status Codes

  • 200 - Success
  • 401 - Unauthorized (missing or invalid token)
  • 403 - Forbidden (user does not have reporter or admin role)

Testing Dashboard Access

You can test dashboard endpoints with different user roles using the test credentials:
# Login as admin
TOKEN=$(curl -X POST http://localhost:8000/api/autenticacion/iniciar-sesion \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"12345678"}' \
  | jq -r '.data.token')

# Access admin dashboard
curl -X GET http://localhost:8000/api/admin/dashboard \
  -H "Authorization: Bearer $TOKEN"

Error Handling

All dashboard endpoints return standard error responses for authentication and authorization failures:

401 Unauthorized

Returned when no authentication token is provided or the token is invalid:
{
  "message": "Unauthenticated."
}

403 Forbidden

Returned when the user does not have the required role:
{
  "message": "This action is unauthorized."
}

Authentication

Learn how to obtain authentication tokens

Roles & Permissions

Understand the role system and permissions

User Profile

Get authenticated user information

Quick Start

Get started with GIMA API

Build docs developers (and LLMs) love