Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/akibanks/api-tienda-vinilos/llms.txt

Use this file to discover all available pages before exploring further.

The browsing history endpoints let clients record and retrieve the records a user has viewed. The history is capped at 10 unique items per user — when a new item is added and the cap is reached, the oldest entry is evicted (FIFO). Duplicate discogs_id values are upserted: if the release is already in the user’s history, the server updates its visto_en timestamp instead of creating a duplicate row.

POST /historial

Record a vinyl release that the authenticated user has just viewed.
MethodPOST
Path/historial
AuthJWT required (Authorization: Bearer <token>)

Request body

discogs_id
string
required
The Discogs release ID for the viewed record (e.g. "249504").
titulo
string
required
Title of the vinyl release as returned by the Discogs API.
artista
string
required
Artist name for the release.
genero
string
Primary genre of the release (e.g. "Rock", "Jazz"). Used to power personalised recommendations — omitting it degrades recommendation quality.
estilo
string
Primary style sub-tag of the release (e.g. "Classic Rock", "Bebop").

Responses

201 — History updated
{
  "mensaje": "Historial actualizado."
}
400 — Missing required fields
{
  "error": "discogs_id, titulo y artista son requeridos."
}
401 — Invalid or missing token
{
  "error": "Token de autenticación requerido."
}
{
  "error": "Token inválido o expirado. Vuelve a iniciar sesión."
}

Example

curl -X POST https://api.vinylvibes.example/historial \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "discogs_id": "249504",
    "titulo": "The Dark Side of the Moon",
    "artista": "Pink Floyd",
    "genero": "Rock",
    "estilo": "Psychedelic Rock"
  }'

GET /historial

Retrieve the authenticated user’s browsing history, sorted from most recently viewed to oldest.
MethodGET
Path/historial
AuthJWT required (Authorization: Bearer <token>)

Request params

No query parameters. The user is identified entirely from the JWT payload.

Response

Returns a JSON array of up to 50 history objects, ordered newest first.
id_historial
integer
Primary key of the history row.
id_usuario
integer
ID of the user who viewed the record.
discogs_id
string
Discogs release ID of the viewed record.
titulo
string
Title of the release.
artista
string
Artist name of the release.
genero
string | null
Genre recorded at view time. null if not supplied when the history entry was created.
estilo
string | null
Style sub-tag recorded at view time. null if not supplied.
visto_en
string
ISO 8601 datetime of the most recent view (e.g. "2024-11-03T18:45:00.000Z").

Example

curl https://api.vinylvibes.example/historial \
  -H "Authorization: Bearer $TOKEN"
200 response
[
  {
    "id_historial": 88,
    "id_usuario": 5,
    "discogs_id": "249504",
    "titulo": "The Dark Side of the Moon",
    "artista": "Pink Floyd",
    "genero": "Rock",
    "estilo": "Psychedelic Rock",
    "visto_en": "2024-11-03T18:45:00.000Z"
  },
  {
    "id_historial": 74,
    "id_usuario": 5,
    "discogs_id": "870745",
    "titulo": "Kind of Blue",
    "artista": "Miles Davis",
    "genero": "Jazz",
    "estilo": "Modal",
    "visto_en": "2024-11-02T11:20:00.000Z"
  }
]
Although the store caps history at 10 items per user, GET /historial returns up to 50 records. This higher limit accommodates history rows that existed before the per-user cap was introduced, ensuring no legacy data is silently dropped.

Build docs developers (and LLMs) love