Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/luiss811/Backend-Airguide/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint is the backend target for QR codes displayed at event venues. When a visitor scans a QR code, their device calls this endpoint, and the event’s asistentes_confirmados counter increments by one. Because the endpoint is intentionally public, no login or token is required — anyone present at the venue can confirm attendance by scanning.

Confirm attendance

POST /api/eventos/:id/confirmar-asistencia

Path parameters

id
integer
required
The event’s id_evento. This value is typically encoded in the QR code displayed at the venue.

Request body

No request body is required or expected.

Response

message
string
Confirmation message. Always "Asistencia confirmada" on success.
asistentes_confirmados
integer
The updated total count of confirmed attendees after this increment.
Returns 404 if no event exists with the given id.
curl -X POST https://your-domain/api/eventos/42/confirmar-asistencia

Example response

{
  "message": "Asistencia confirmada",
  "asistentes_confirmados": 37
}

Attendance fields on the Evento model

Each event tracks two attendance-related counts:
total_invitados
integer
default:"0"
The expected number of attendees. Set when the event is created (or updated) via the total_invitados body field. This value does not change automatically — it represents the invitation list size or venue capacity you recorded at scheduling time.
asistentes_confirmados
integer
default:"0"
The running count of QR code scans received for this event. Every successful call to POST /api/eventos/:id/confirmar-asistencia increments this value by exactly 1. It starts at 0 and has no upper bound enforced by the API.
To calculate an attendance rate, divide asistentes_confirmados by total_invitados. Both fields are returned on every event object from GET /api/eventos and GET /api/eventos/:id.

How QR code attendance works

The typical flow is:
  1. An admin creates an event with a known guest count (total_invitados).
  2. A QR code is generated that encodes the confirmation URL — e.g. https://your-domain/api/eventos/42/confirmar-asistencia.
  3. The QR code is displayed at the venue entrance (printed poster, screen, badge, etc.).
  4. Each attendee scans the code with their phone. The scan triggers a POST to this endpoint.
  5. asistentes_confirmados increases by 1 for each scan.
  6. Admins can monitor turnout in real time by polling GET /api/eventos/42.
Because no authentication is required, a single visitor could scan the code multiple times and increment the counter more than once. If accurate deduplication is important for your use case, consider adding client-side controls (e.g. disabling the QR code after first scan on a managed device).

Build docs developers (and LLMs) love