Introduction
Esta es la documentación del
API de la creación de horarios.
Authenticating requests
To authenticate requests, include a Authorization header with the value "Bearer {Escribe aquí tu token}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Actividades
Listar actividades
Este endpoint devuelve todas las actividades de un horario específico, si el usuario tiene permisos para verlo.
Obtener lista de actividades de un horario
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request GET \
--get "https://api-timetables.escuelait.com/api/timetables/1/activities" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1/activities"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Actividades encontradas",
"data": {
"activities": [
{
"id": 1,
"day": "Monday",
"start_time": "08:00",
"duration": 60,
"info": "Clase de Matemáticas",
"is_available": true,
"timetable_id": 1,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
}
]
}
}
Example response (403):
{
"message": "No tienes permiso para ver este horario",
"errors": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Crear nueva actividad en un horario
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request POST \
"https://api-timetables.escuelait.com/api/timetables/1/activities" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"day\": 1,
\"start_time\": \"08:00\",
\"duration\": 60,
\"info\": \"Clase de Matemáticas\",
\"is_available\": true
}"
const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1/activities"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"day": 1,
"start_time": "08:00",
"duration": 60,
"info": "Clase de Matemáticas",
"is_available": true
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"message": "Actividad creada correctamente",
"data": {
"activity": {
"id": 1,
"timetable_id": 1,
"day": "Monday",
"start_time": "08:00",
"duration": 60,
"info": "Clase de Matemáticas",
"is_available": true,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
}
}
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"day": [
"The day field is required."
],
"start_time": [
"The start time must be a valid time."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener una actividad por ID
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request GET \
--get "https://api-timetables.escuelait.com/api/timetables/1/activities/3" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1/activities/3"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Actividad encontrada",
"data": {
"activity": {
"id": 3,
"day": "Tuesday",
"start_time": "10:00",
"duration": 90,
"info": "Laboratorio de Física",
"is_available": true,
"timetable_id": 1,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
}
}
}
Example response (403):
{
"message": "No tienes permiso para ver esta actividad",
"errors": []
}
Example response (404):
{
"message": "La actividad no pertenece a este horario",
"errors": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar una actividad
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request PUT \
"https://api-timetables.escuelait.com/api/timetables/1/activities/4" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"day\": 1,
\"start_time\": \"10:30\",
\"duration\": 90,
\"info\": \"Tutoría personalizada\",
\"is_available\": false
}"
const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1/activities/4"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"day": 1,
"start_time": "10:30",
"duration": 90,
"info": "Tutoría personalizada",
"is_available": false
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"message": "Actividad actualizada correctamente",
"data": {
"id": 4,
"day": "Wednesday",
"start_time": "10:30",
"duration": 90,
"info": "Tutoría personalizada",
"is_available": false,
"timetable_id": 1,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T14:00:00.000000Z"
}
}
Example response (404):
{
"message": "La actividad no pertenece a este horario",
"errors": []
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"start_time": [
"The start time must be a valid time."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Eliminar una actividad
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request DELETE \
"https://api-timetables.escuelait.com/api/timetables/1/activities/4" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1/activities/4"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Actividad eliminada correctamente",
"data": []
}
Example response (403):
{
"message": "No tienes permiso para eliminar esta actividad",
"errors": []
}
Example response (404):
{
"message": "La actividad no pertenece a este horario",
"errors": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Autenticación
Registro de nuevo usuario
Este endpoint permite registrar un nuevo usuario en el sistema. Devuelve el usuario creado junto con un token de autenticación.
Registrar un nuevo usuario
Example request:
curl --request POST \
"https://api-timetables.escuelait.com/api/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Juan Pérez\",
\"email\": \"juan@example.com\",
\"password\": \"secret123\",
\"password_confirmation\": \"secret123\"
}"
const url = new URL(
"https://api-timetables.escuelait.com/api/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Juan Pérez",
"email": "juan@example.com",
"password": "secret123",
"password_confirmation": "secret123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"message": "Registro exitoso",
"data": {
"user": {
"id": 1,
"name": "Juan Pérez",
"email": "juan@example.com",
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
},
"token": "1|aBcD123xyz..."
}
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email has already been taken."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Iniciar sesión
Example request:
curl --request POST \
"https://api-timetables.escuelait.com/api/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"juan@example.com\",
\"password\": \"secret123\"
}"
const url = new URL(
"https://api-timetables.escuelait.com/api/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "juan@example.com",
"password": "secret123"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"message": "Inicio de sesión exitoso",
"data": {
"user": {
"id": 1,
"name": "Juan Pérez",
"email": "juan@example.com",
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
},
"token": "1|aBcD123xyz..."
}
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"email": [
"Las credenciales son incorrectas."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener usuario autenticado
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request GET \
--get "https://api-timetables.escuelait.com/api/user" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/user"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Usuario encontrado",
"data": {
"id": 1,
"name": "Juan Pérez",
"email": "juan@example.com",
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Cerrar sesión
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request POST \
"https://api-timetables.escuelait.com/api/logout" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/logout"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Sesión cerrada",
"data": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Horarios
Listar horarios
Este endpoint devuelve todos los horarios creados por el usuario autenticado, ordenados del más reciente al más antiguo.
Obtener lista de horarios del usuario autenticado
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request GET \
--get "https://api-timetables.escuelait.com/api/timetables" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/timetables"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Lista de horarios obtenida correctamente",
"data": [
{
"id": 1,
"name": "Mañana",
"description": "Turno de mañana de 8 a 12",
"user_id": 1,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
},
{
"id": 2,
"name": "Tarde",
"description": "Turno de tarde de 14 a 18",
"user_id": 1,
"created_at": "2025-03-26T13:00:00.000000Z",
"updated_at": "2025-03-26T13:00:00.000000Z"
}
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Obtener un horario por ID
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request GET \
--get "https://api-timetables.escuelait.com/api/timetables/1" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Horario obtenido correctamente",
"data": {
"id": 1,
"name": "Mañana",
"description": "Turno de mañana de 8 a 12",
"user_id": 1,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z",
"activities": [
{
"id": 10,
"name": "Matemáticas",
"start_time": "08:00",
"end_time": "09:00"
}
]
}
}
Example response (403):
{
"message": "No tienes permiso para ver este horario",
"errors": []
}
Example response (404):
{
"message": "No encontrado",
"errors": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Crear nuevo horario
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request POST \
"https://api-timetables.escuelait.com/api/timetables" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Mañana\",
\"description\": \"Turno de mañana de 8 a 12\"
}"
const url = new URL(
"https://api-timetables.escuelait.com/api/timetables"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Mañana",
"description": "Turno de mañana de 8 a 12"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (201):
{
"message": "Horario creado correctamente",
"data": {
"id": 1,
"name": "Mañana",
"description": "Turno de mañana de 8 a 12",
"user_id": 1,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T12:00:00.000000Z"
}
}
Example response (403):
{
"message": "No tienes permiso para crear horarios",
"errors": []
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
],
"description": [
"The description field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Actualizar un horario
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request PUT \
"https://api-timetables.escuelait.com/api/timetables/1" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Tarde\",
\"description\": \"Turno de tarde de 14 a 18\"
}"
const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Tarde",
"description": "Turno de tarde de 14 a 18"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Example response (200):
{
"message": "Horario actualizado correctamente",
"data": {
"id": 1,
"name": "Tarde",
"description": "Turno de tarde de 14 a 18",
"user_id": 1,
"created_at": "2025-03-26T12:00:00.000000Z",
"updated_at": "2025-03-26T13:00:00.000000Z"
}
}
Example response (403):
{
"message": "No tienes permiso para modificar este horario",
"errors": []
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Eliminar un horario
requires authentication
Requiere autenticación con token Bearer.
Example request:
curl --request DELETE \
"https://api-timetables.escuelait.com/api/timetables/1" \
--header "Authorization: Bearer {Escribe aquí tu token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://api-timetables.escuelait.com/api/timetables/1"
);
const headers = {
"Authorization": "Bearer {Escribe aquí tu token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Example response (200):
{
"message": "Horario eliminado correctamente",
"data": []
}
Example response (403):
{
"message": "No tienes permiso para eliminar este horario",
"errors": []
}
Example response (404):
{
"message": "No encontrado",
"errors": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.