Track APIs Documentation
The GeneralController
handles getting information about
media objects. This documentation covers the Tracks related endpoints.
Controller Route: /api
All routes within the GeneralController
are prefixed by
/api
.
Summary of Endpoints
Endpoint | Method | Description | Authorization |
---|---|---|---|
/api/track |
GET | Fetch the details of a specific track by its ID. | Admin, User, Pass |
/api/tracks |
POST | Fetch details of multiple tracks using a list of track IDs. | Admin, User, Pass |
/api/track/path |
GET | Fetch the file path of a specific track by its ID. | Admin |
/api/lyrics |
GET | Fetch the lyrics of a specific track by its ID. | Admin, User, Pass |
Get Track Details
Fetch the details of a specific track by its ID.
Details:
- Endpoint:
/api/track
- Method:
GET
- Authorization: JWT (Roles: Admin, User, Pass)
Parameters:
- id (string, required): The ID of the track.
Responses:
- 200 OK: Returns the track details excluding the path and lyrics path.
- 404 Not Found: If the track does not exist.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/track?id=66bc99b8ab7ba419497e21af" \
-H "Authorization: Bearer <JWT-token>"
Get Multiple Tracks
Fetch details of multiple tracks using a list of track IDs.
Details:
- Endpoint:
/api/tracks
- Method:
GET
- Authorization: JWT (Roles: Admin, User, Pass)
Parameters:
-
ids (
List<string>
, required): A list of track IDs.
Responses:
- 200 OK: Returns a list of tracks with details excluding the path and lyrics path.
- 404 Not Found: If none of the tracks exist.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/tracks?ids=66bc9a9cab7ba419497e616c&ids=66bc9aadab7ba419497e7088" \
-H "Authorization: Bearer <JWT-token>"
Get Track Path
Fetch the file path of a specific track by its ID.
Details:
- Endpoint:
/api/track/path
- Method:
GET
- Authorization: JWT (Roles: Admin)
Parameters:
- id (string, required): The ID of the track.
Responses:
- 200 OK: Returns the file path of the track.
- 404 Not Found: If the track does not exist.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/track/path?id=66bc9a9cab7ba419497e616c" \
-H "Authorization: Bearer <JWT-token>"
Get Track Lyrics
Fetch the lyrics of a specific track by its ID.
Details:
- Endpoint:
/api/lyrics
- Method:
GET
- Authorization: JWT (Roles: Admin, User)
Parameters:
- id (string, required): The ID of the track.
Responses:
- 200 OK: Returns the lyrics of the track.
- 404 Not Found: If the track or its lyrics do not exist.
Example Request (using curl
):
curl -X GET "https://your-melon-server.com/api/lyrics?id=66bc9a9cab7ba419497e616c" \
-H "Authorization: Bearer <JWT-token>"