Skip to main content
GET
/
report
/
export
curl -X GET https://api.example.com/report/export \
  -H "Content-Type: application/json" \
  -b "access_token=YOUR_JWT_TOKEN" \
  --output report.xlsx
{
  "message": "Token no enviado o inválido"
}
This endpoint generates an Excel file containing two reports: actual reservation data and estimated (projected) reservation data. The file contains two separate sheets and is automatically downloaded when the request completes. The user must be authenticated with a valid JWT token stored in the access_token cookie.

Response

The response is a binary Excel file (.xlsx) that is automatically downloaded. The file contains two sheets:

Sheet 1: Reporte

FECHA
date
Date of the reservation data
Additional fields
various
The actual report contains additional fields from the REPORT database table, which may include reservation counts, revenue, occupancy rates, and other metrics ordered chronologically.

Sheet 2: Reporte_Estimado

FECHA
date
Date of the projected reservation data
Additional fields
various
The estimated report contains projected fields from the estimated_report database table, which may include forecasted reservation counts, projected revenue, expected occupancy rates, and other estimated metrics ordered chronologically.

Download Process

  1. The endpoint queries both the REPORT and estimated_report tables
  2. Data is ordered by date (FECHA) in ascending order
  3. An Excel workbook is generated with two sheets:
    • “Reporte” - Actual data
    • “Reporte_Estimado” - Estimated data
  4. The file is sent as a binary download with filename report.xlsx

Headers

The response includes the following headers:
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
Content-Disposition: attachment; filename=report.xlsx

Status Codes

200
Success
Excel file generated and downloaded successfully
401
Unauthorized
Token not sent or invalid (cookie missing or expired)
500
Internal Server Error
Internal server error during report generation
curl -X GET https://api.example.com/report/export \
  -H "Content-Type: application/json" \
  -b "access_token=YOUR_JWT_TOKEN" \
  --output report.xlsx
{
  "message": "Token no enviado o inválido"
}

Notes

  • The Excel file is generated dynamically from the database
  • Both sheets contain data ordered by date (FECHA field)
  • The actual file structure depends on the schema of the REPORT and estimated_report tables
  • Large datasets may take longer to generate
  • Ensure your client properly handles binary downloads

Build docs developers (and LLMs) love