Skip to main content

Overview

The Favorite Tours API allows tourists to save tours to their favorites list for easy access. This creates a personalized wishlist of tours they’re interested in.

Base URL

/api/favorite-tours

Get All Favorite Tours

Retrieve all favorite tours across all users (typically used for admin purposes).
curl -X GET "https://api.kinconecta.com/api/favorite-tours" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

favorites
Array<FavoriteTour>
List of all favorite tour records

Get Favorite by ID

Retrieve a specific favorite tour record.
curl -X GET "https://api.kinconecta.com/api/favorite-tours/{favoriteId}" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

favoriteId
Long
required
The ID of the favorite tour record

Response

Returns a single FavoriteTour object.

Get Favorites by Tourist

Retrieve all favorite tours for a specific tourist.
curl -X GET "https://api.kinconecta.com/api/favorite-tours/tourist/{touristId}" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

touristId
Long
required
The ID of the tourist

Response

Returns an array of FavoriteTour objects for the specified tourist.

Add Tour to Favorites

Add a tour to a tourist’s favorites list.
curl -X POST "https://api.kinconecta.com/api/favorite-tours" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "touristId": 456,
    "tourId": 789
  }'

Request Body

touristId
Long
required
ID of the tourist adding the favorite
tourId
Long
required
ID of the tour to add to favorites

Response

Returns the created FavoriteTour object with generated ID and timestamp.
{
  "favoriteId": 123,
  "touristId": 456,
  "tourId": 789,
  "createdAt": "2024-03-10T15:30:00Z"
}

Remove Tour from Favorites

Remove a tour from a tourist’s favorites list.
curl -X DELETE "https://api.kinconecta.com/api/favorite-tours/{favoriteId}" \
  -H "Authorization: Bearer YOUR_TOKEN"

Path Parameters

favoriteId
Long
required
The ID of the favorite record to delete

Response

Returns the deleted FavoriteTour object.
The favorite record is deleted from the database. The tourist can add the tour back to favorites at any time.

Use Cases

Build Wishlist

Tourists can save interesting tours while browsing to review later

Compare Tours

Keep track of multiple tours to compare features and prices

Share Recommendations

Create a list of favorite tours to share with travel companions

Track Interests

Guides can see which tours are most favorited to understand demand

Build docs developers (and LLMs) love