This documentation provides details about the REST API endpoints for the AeToons application. This application allows users to manage shows and episodes while integrating with Vimeo and the MyAnimeList (MAL) API for extended functionality.
- URL:
/
- Method:
GET
- Description: Simple test endpoint to verify the API is running.
- Response:
{ "test": "success" }
- URL:
/shows
- Method:
GET
- Description: Retrieves all shows stored in the database.
- Response:
- Status Code:
200 OK
- Body:
[ { "id": 1, "title": "One Piece", "main_picture": { "medium": "https://cdn.myanimelist.net/images/anime/1244/138851.jpg", "large": "https://cdn.myanimelist.net/images/anime/1244/138851l.jpg" }, "episodes": [ { "id": 1, "title": "Episode 1", "episode_number": 1, "video_url": "video-url" } ] } ]
- Status Code:
- URL:
/add-show
- Method:
POST
- Description: Adds a new show to the database using data from the MAL API.
- Request Body (JSON):
{ "mal_id": 21 }
- Response:
- Status Code:
200 OK
- Body:
{ "id": 21, "title": "One Piece", "main_picture": { "medium": "medium.jpg", "large": "large.jpg" } }
- Status Code:
- URL:
/add-episode
- Method:
POST
- Description: Adds a new episode by uploading a video file. The video is transcribed and uploaded to Vimeo.
- Form Data:
title
(string, required): The title of the episode.episode_number
(integer, required): The episode number.show_id
(integer, required): The ID of the show.file
(file, required): The video file to upload.
- Response:
- Status Code:
200 OK
- Body:
{ "id": 1, "title": "Episode 1", "episode_number": 1, "video_url": "video-url", "show_id": 1 }
- Status Code:
- URL:
/add-episode-from-url
- Method:
POST
- Description: Adds a new episode by providing a video URL. The video is downloaded, transcribed, and uploaded to Vimeo.
- Request Body (JSON):
{ "title": "Episode 1", "episode_number": 1, "show_id": 1, "video_url": "video-url" }
- Response:
- Status Code:
200 OK
- Body:
{ "id": 1, "title": "Episode 1", "episode_number": 1, "video_url": "video-url", "show_id": 1 }
- Status Code:
{
"id": 1,
"title": "One Piece",
"main_picture": {
"medium": "medium.jpg",
"large": "medium.jpg"
},
"episodes": [
{
"id": 1,
"title": "Episode 1",
"episode_number": 1,
"video_url": "video-url"
}
]
}
{
"id": 1,
"title": "Episode 1",
"episode_number": 1,
"video_url": "video-url",
"show_id": 1
}
-
400 Bad Request:
- Missing or invalid fields in the request.
{ "error": "Missing required fields" }
-
500 Internal Server Error:
- Server-side errors, such as issues with file uploads, database operations, or external API calls.
{ "error": "Failed to save file" }
- Ensure the MAL Client ID is correctly set in the configuration (
MAL_AUTH_PARAM_NAME
) for adding shows. - The upload directory for videos is
./uploads/
. Ensure this directory is writable by the server. - Subtitles are automatically generated during the transcription process.
For additional questions or issues, refer to the AeToons documentation or contact the API support team.