Skip to main content

Overview

The Compatibility Profiles API allows you to manage compatibility profiles for users (travelers and guides) and their compatibility questionnaire answers. This system supports the matching algorithm that connects travelers with suitable guides based on their preferences and characteristics.

Compatibility Profile Endpoints

Create Compatibility Profile

curl -X POST http://localhost:8080/api/compatibility_profiles \
  -H "Content-Type: application/json" \
  -d '{
    "userId": 123,
    "role": "TRAVELER",
    "name": "John Doe",
    "imgUrl": "https://example.com/profile.jpg",
    "description": "Adventure-seeking traveler",
    "email": "[email protected]",
    "dateOfBirth": "1990-05-15",
    "phoneCountryCode": "+1",
    "phoneNumber": "5551234567",
    "phoneE164": "+15551234567"
  }'
Creates a new compatibility profile for a user.
userId
Long
required
The ID of the user this profile belongs to
role
enum
required
The role of the user. Possible values:
  • TRAVELER - For tourist/traveler profiles
  • GUIDE - For guide profiles
name
string
Full name of the user
imgUrl
string
URL to the user’s profile image
description
string
Brief description or bio of the user
email
string
User’s email address
dateOfBirth
date
User’s date of birth in format YYYY-MM-DD
phoneCountryCode
string
Country code for phone number (e.g., “+1”)
phoneNumber
string
Phone number without country code
phoneE164
string
Phone number in E.164 format
compatibilityProfileId
Long
Unique identifier for the compatibility profile
userId
Long
The ID of the user this profile belongs to
role
enum
The role of the user (TRAVELER or GUIDE)
name
string
Full name of the user
imgUrl
string
URL to the user’s profile image
description
string
Brief description or bio of the user
email
string
User’s email address
dateOfBirth
date
User’s date of birth
phoneCountryCode
string
Country code for phone number
phoneNumber
string
Phone number without country code
phoneE164
string
Phone number in E.164 format
createdAt
datetime
Timestamp when the profile was created
updatedAt
datetime
Timestamp when the profile was last updated

Get All Compatibility Profiles

curl http://localhost:8080/api/compatibility_profiles
Retrieves a list of all compatibility profiles.
profiles
array
Array of compatibility profile objects

Get Compatibility Profile by ID

curl http://localhost:8080/api/compatibility_profiles/1
Retrieves a specific compatibility profile by its ID.
id
Long
required
The ID of the compatibility profile to retrieve

Update Compatibility Profile

curl -X PUT http://localhost:8080/api/compatibility_profiles/1 \
  -H "Content-Type: application/json" \
  -d '{
    "userId": 123,
    "role": "TRAVELER",
    "name": "John Doe Updated",
    "imgUrl": "https://example.com/profile-new.jpg",
    "description": "Experienced adventure traveler",
    "email": "[email protected]",
    "dateOfBirth": "1990-05-15",
    "phoneCountryCode": "+1",
    "phoneNumber": "5559876543",
    "phoneE164": "+15559876543"
  }'
Updates an existing compatibility profile.
id
Long
required
The ID of the compatibility profile to update

Delete Compatibility Profile

curl -X DELETE http://localhost:8080/api/compatibility_profiles/1
Deletes a compatibility profile by ID.
id
Long
required
The ID of the compatibility profile to delete
status
204
No content returned on successful deletion

Compatibility Answer Endpoints

Create Compatibility Answer

curl -X POST http://localhost:8080/api/compatibility_answers \
  -H "Content-Type: application/json" \
  -d '{
    "compatibilityProfileId": 1,
    "questionKey": "travel_style",
    "valueText": "adventure",
    "valueNumber": null,
    "valueJson": null
  }'
Creates a new compatibility answer for a profile. Answers store user responses to compatibility questionnaires used in the matching algorithm.
compatibilityProfileId
Long
required
The ID of the compatibility profile this answer belongs to
questionKey
string
required
Unique key identifying the question being answered
valueText
string
Text value for the answer (for text-based questions)
valueNumber
decimal
Numeric value for the answer (for numeric/rating questions)
valueJson
string
JSON string for complex/multi-value answers
answerId
Long
Unique identifier for the answer
compatibilityProfileId
Long
The ID of the compatibility profile
questionKey
string
Unique key identifying the question
valueText
string
Text value for the answer
valueNumber
decimal
Numeric value for the answer
valueJson
string
JSON string for complex answers
createdAt
datetime
Timestamp when the answer was created

Get All Compatibility Answers

curl http://localhost:8080/api/compatibility_answers
Retrieves a list of all compatibility answers.
answers
array
Array of compatibility answer objects

Get Compatibility Answer by ID

curl http://localhost:8080/api/compatibility_answers/1
Retrieves a specific compatibility answer by its ID.
id
Long
required
The ID of the compatibility answer to retrieve

Update Compatibility Answer

curl -X PUT http://localhost:8080/api/compatibility_answers/1 \
  -H "Content-Type: application/json" \
  -d '{
    "compatibilityProfileId": 1,
    "questionKey": "travel_style",
    "valueText": "luxury_adventure",
    "valueNumber": 8.5,
    "valueJson": "{\"preferences\": [\"hiking\", \"cultural\"]}"
  }'
Updates an existing compatibility answer.
id
Long
required
The ID of the compatibility answer to update

Delete Compatibility Answer

curl -X DELETE http://localhost:8080/api/compatibility_answers/1
Deletes a compatibility answer by ID.
id
Long
required
The ID of the compatibility answer to delete
status
204
No content returned on successful deletion

Matching Logic

The compatibility system uses profiles and answers to:
  1. Profile Matching: Match travelers with guides based on role-specific attributes
  2. Preference Alignment: Compare compatibility answers to find best matches
  3. Multi-format Responses: Support text, numeric, and JSON answer formats for flexible questionnaires
  4. Historical Tracking: Maintain creation timestamps for analytics and improvements

Build docs developers (and LLMs) love