Skip to main content

Overview

These endpoints provide access to student academic records (expedientes). There are two variants: one for professor view with complete data, and one for student view with limited fields.
Requests for [email protected] return null values for all activities to prevent data exposure.

Get Complete Student Record (Professor View)

email
string
required
Student’s email address
cURL
curl -X GET "https://proyecto-ingenieria-software-6ccv.onrender.com/expediente_completo/[email protected]" \
  -H "Content-Type: application/json"

Response Structure

Returns an object containing all forum responses and exam submissions for the specified student.

Response Example

{
  "foro1": {
    "email": "[email protected]",
    "r1": "Student response text",
    "r2": "Additional response data",
    "imagen": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."
  },
  "foro2": {
    "email": "[email protected]",
    "r1": "Response content",
    "r2": "More data"
  },
  "foro3": { /* ... */ },
  "foro4": { /* ... */ },
  "foro5": { /* ... */ },
  "foro6": { /* ... */ },
  "examen1": { /* ... */ },
  "examen2": { /* ... */ }
}

Admin Account Response

When requesting data for [email protected], all fields return null:
{
  "foro1": null,
  "foro2": null,
  "foro3": null,
  "foro4": null,
  "foro5": null,
  "foro6": null,
  "examen1": null,
  "examen2": null
}

Get Student Record (Student View)

email
string
required
Student’s email address
cURL
curl -X GET "https://proyecto-ingenieria-software-6ccv.onrender.com/expediente_completo_alumno/[email protected]" \
  -H "Content-Type: application/json"

Response Structure

Returns a limited view of student records with only specific fields (typically r2 or r5 fields).
This endpoint returns limited data suitable for student self-view:
  • Forums 1-4, 6: Returns only r2 field
  • Forum 5: Returns only r5 field
  • Exams 1-2: Returns only r2 field
  • No image data conversion is performed

Response Example

{
  "foro1": {
    "r2": "Student's response content"
  },
  "foro2": {
    "r2": "Response data"
  },
  "foro3": {
    "r2": "Response content"
  },
  "foro4": {
    "r2": "Response data"
  },
  "foro5": {
    "r5": "Specific field for forum 5"
  },
  "foro6": {
    "r2": "Response content"
  },
  "examen1": {
    "r2": "Exam submission data"
  },
  "examen2": {
    "r2": "Exam submission data"
  }
}

Image Data Conversion

The convertir_bytes function (lines 395-408) automatically processes binary data:
def convertir_bytes(registro):
    if not registro:
        return
    claves = list(registro.keys())
    for clave in claves:
        valor = registro[clave]
        if isinstance(valor, memoryview):
            valor = bytes(valor)
        if isinstance(valor, (bytes, bytearray)):
            encoded = base64.b64encode(valor).decode("utf-8")
            if 'imagen' in clave.lower():
                registro[clave] = f"data:image/jpeg;base64,{encoded}"
            else:
                registro[clave] = encoded
  • Converts memoryview and binary data to base64
  • Fields containing “imagen” are formatted as data URLs
  • Applied to all forum responses (foro1-6) in professor view
  • Not applied in student view endpoint

Error Responses

500
error
Database connection error
{
  "detail": "Error BD"
}

Build docs developers (and LLMs) love