Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jparra-amell/api_solsql/llms.txt

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

The Favorites API lets users bookmark places they want to revisit. Each favorite record links a user (id) to a place (place_id). You can retrieve favorites by user, check whether a specific user-place pair is already favorited, or remove a favorite using either its primary key or the user-place combination directly.

GET /api/Favorites

Returns all favorites in the system.

Response

favorite_id
integer
Unique identifier for the favorite record.
id
integer
ID of the user who saved the favorite.
name_user
string
Display name of the user.
place_id
integer
ID of the favorited place.
name_place
string
Display name of the place.
added_date
string (datetime)
ISO 8601 timestamp of when the favorite was added.
curl -X GET https://your-api-host/api/Favorites

GET /api/Favorites/

Returns a single favorite record by its ID.

Path parameters

id
integer
required
The unique ID of the favorite record to retrieve.

Response

Returns a single Favorites object. See field descriptions under GET /api/Favorites.
curl -X GET https://your-api-host/api/Favorites/8

Error codes

CodeDescription
404No favorite found with the given id.
500Internal server error.

GET /api/Favorites/byUser/

Returns all favorites saved by a specific user.

Path parameters

user_id
integer
required
The ID of the user whose favorites you want to retrieve.

Response

Returns an array of Favorites objects. See field descriptions under GET /api/Favorites.
curl -X GET https://your-api-host/api/Favorites/byUser/3

Error codes

CodeDescription
500Internal server error.
This endpoint returns an empty array if the user has no favorites — it does not return 404.

GET /api/Favorites/user//place/

Returns the favorite record for a specific user-place combination. Use this to check whether a user has already saved a particular place before showing a “Save” button.

Path parameters

userId
integer
required
The ID of the user.
placeId
integer
required
The ID of the place.

Response

Returns a single Favorites object. See field descriptions under GET /api/Favorites.
curl -X GET https://your-api-host/api/Favorites/user/3/place/7

Error codes

CodeDescription
404No favorite found for the given userId and placeId.
500Internal server error.
A 404 from this endpoint means the user has not yet favorited the place — safe to show an “Add to favorites” action.

POST /api/Favorites

Adds a place to a user’s favorites list.

Request body

id
integer
required
ID of the user adding the favorite.
place_id
integer
required
ID of the place to add.

Response

Returns 200 OK with a JSON success message:
{
  "message": "Favorito agregado correctamente."
}
curl -X POST https://your-api-host/api/Favorites \
  -H "Content-Type: application/json" \
  -d '{
    "id": 3,
    "place_id": 7
  }'

Error codes

CodeDescription
400The database rejected the insert (e.g., the place is already favorited).
500Internal server error.
If a user tries to add the same place twice, the database raises a constraint error and the API returns 400 Bad Request with an error detail in the response body.

DELETE /api/Favorites/

Deletes a favorite record by its primary key.

Path parameters

id
integer
required
The favorite_id of the record to delete.

Response

Returns 204 No Content on successful deletion.
curl -X DELETE https://your-api-host/api/Favorites/8

Error codes

CodeDescription
400Database error — could not delete the record (e.g., constraint).
500Internal server error.

DELETE /api/Favorites/usuario//lugar/

Deletes a favorite identified by the user and place combination. Use this when you want to remove a favorite without looking up its favorite_id first.

Path parameters

idUsuario
integer
required
The ID of the user whose favorite you want to remove.
idLugar
integer
required
The ID of the place to unfavorite.

Response

Returns 204 No Content on successful deletion.
curl -X DELETE https://your-api-host/api/Favorites/usuario/3/lugar/7

Error codes

CodeDescription
400Database error — could not delete the record (e.g., constraint).
500Internal server error.

Build docs developers (and LLMs) love