Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alfonsoolavarria/florilegio/llms.txt

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

When a reader opens a book in Florilegio’s study interface, the frontend calls this endpoint to load the introductory panel — author, approximate date of writing, and a narrative context paragraph. The data is stored in the ContextoLibro model as a JSON string and deserialized on each request by ContextoLibro.get_contenido().

Endpoint

GET /api/contexto/<libro_numero>/
Rate limit: 200 requests / minute per IP

Path Parameters

libro_numero
integer
required
The Bible book number, 1–66. This is matched against the numero field of the related LibroBiblia record. Genesis = 1, Psalms = 19, Matthew = 40, Revelation = 66.

Response (success — HTTP 200)

{
  "status": "success",
  "data": {
    "contenido": {
      "titulo": "Génesis",
      "autor": "Moisés",
      "fecha": "c. 1446–1406 a.C.",
      "contexto": "El libro del Génesis es el primero del Pentateuco..."
    }
  }
}
status
string
Always "success" on a successful response.
data.contenido
object
The deserialized JSON object stored in ContextoLibro.contenido. The exact keys within this object are determined by the content editors who create each entry via the Django admin. Common keys include titulo, autor, fecha, and contexto, but additional fields may be present.
contenido is stored as a raw JSON string in the database and deserialized at read time by ContextoLibro.get_contenido(), which calls json.loads() on the field. If the stored value is not valid JSON, this method will raise a json.JSONDecodeError and the endpoint will return HTTP 500.

Response (error — HTTP 404)

Returned when no ContextoLibro record exists for the given libro_numero.
{"status": "error", "message": "No hay contexto disponible para este libro."}
status
string
Always "error" when the book context is not found.
message
string
A fixed Spanish-language message: "No hay contexto disponible para este libro."

Build docs developers (and LLMs) love