Overview
The Resources API allows you to manage learning materials that support course topics. Resources can be videos, PDF documents, or presentations, each with metadata like duration, descriptions, and URLs. Resources are linked to specific topics and optionally to the instructor who created them.Endpoints
List All Resources
Retrieve a list of all learning resources in the system.Response
Indicates if the request was successful
Response message: “Recursos listados con éxito”
Array of resource objects
Example Request
Example Response
Create Resource
Create a new learning resource.Request Body
ID of the topic this resource belongs to
ID of the instructor creating this resource (optional)
Type of resource. Must be one of:
video, pdf, presentacionTitle of the resource (maximum 200 characters)
Detailed description of the resource (optional)
URL where the resource is hosted (maximum 500 characters, optional)
Duration in minutes (optional, typically used for videos)
Active status (0 = inactive, 1 = active)
Response
Indicates if the resource was created successfully
Response message: “Recurso creado con éxito”
The created resource object with all fields
Example Request
Example Response
Get Resource
Retrieve a specific resource by ID.Path Parameters
The unique identifier of the resource
Response
Indicates if the request was successful
Response message: “Recurso obtenido con éxito”
The resource object with all fields
Example Request
Example Response
Update Resource
Update an existing resource.Path Parameters
The unique identifier of the resource to update
Request Body
ID of the topic this resource belongs to
ID of the instructor
Type of resource:
video, pdf, or presentacionTitle of the resource (maximum 200 characters)
Detailed description
Resource URL (maximum 500 characters)
Duration in minutes
Active status (0 or 1)
Response
Indicates if the update was successful
Response message: “Recurso actualizado con éxito”
The updated resource object
Example Request
Example Response
Delete Resource
Delete a resource from the system.Path Parameters
The unique identifier of the resource to delete
Response
Indicates if the deletion was successful
Response message: “Recurso eliminado con éxito”
Returns null after successful deletion
Example Request
Example Response
Foreign Key Relationships
Topics Relationship
- Field:
topics_id - References:
topics.id - On Delete: CASCADE (deleting a topic will delete all associated resources)
Instructor Relationship
- Field:
docente_id - References:
users.id - On Delete: SET NULL (deleting a user will set the field to null, preserving the resource)
Notes
- The
tipofield is restricted to three values:video,pdf, orpresentacion - The
duracion_minfield is typically used for video resources to indicate playback time - Resources are soft-deletable via the
activoflag (set to 0) without removing from database - All resources must be associated with a valid topic via
topics_id - The
urlfield can store external links or internal storage paths