Skip to main content

Overview

The User Management API provides endpoints for user authentication, registration, and profile management. All endpoints are prefixed with /kinconecta/api/user.

Authentication

Login User

Validates user credentials and returns authentication status.
curl -X POST http://localhost:8080/kinconecta/api/user/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securePassword123"
  }'
Endpoint: POST /kinconecta/api/user/login
email
string
required
User’s email address
password
string
required
User’s password
response
boolean
Returns true if credentials are valid, false otherwise

User Operations

Get All Users

Retrieve a list of all registered users in the system.
curl -X GET http://localhost:8080/kinconecta/api/user
Endpoint: GET /kinconecta/api/user
response
array
Array of user objects

Get User by ID

Retrieve a specific user by their ID.
curl -X GET http://localhost:8080/kinconecta/api/user/John_Doe_123
Endpoint: GET /kinconecta/api/user/{fullName}_{userId}
fullName
string
required
User’s full name (used in URL path)
userId
long
required
User’s unique identifier
response
object
User object with all fields (see structure in Get All Users)

Create User

Register a new user in the system.
curl -X POST http://localhost:8080/kinconecta/api/user \
  -H "Content-Type: application/json" \
  -d '{
    "role": "TOURIST",
    "fullName": "John Doe",
    "dateOfBirth": "1990-05-15",
    "email": "[email protected]",
    "password": "securePassword123",
    "countryCode": "+1",
    "phoneNumber": "5551234567",
    "phoneE164": "+15551234567",
    "preferedLanguageCode": "EN",
    "accountStatus": "OFFLINE",
    "emailVerifiedAt": "2024-03-10T10:00:00Z",
    "lastLogin": "2024-03-10T10:00:00Z",
    "createdAt": "2024-03-10T10:00:00Z",
    "updatedAt": "2024-03-10T10:00:00Z"
  }'
Endpoint: POST /kinconecta/api/user
role
enum
required
User role: TOURIST, GUIDE, or ADMIN
fullName
string
required
User’s full name
dateOfBirth
date
required
User’s date of birth (YYYY-MM-DD format)
email
string
required
User’s email address
password
string
required
User’s password
countryCode
string
required
Country code for phone number (e.g., +1, +52)
phoneNumber
string
required
User’s phone number
phoneE164
string
required
Phone number in E.164 international format
preferedLanguageCode
enum
required
Preferred language code
accountStatus
enum
required
Account status: ONLINE or OFFLINE
emailVerifiedAt
datetime
required
Email verification timestamp
lastLogin
datetime
required
Last login timestamp
createdAt
datetime
required
Account creation timestamp
updatedAt
datetime
required
Last update timestamp
response
object
Created user object with generated ID

Update User

Update an existing user’s information.
curl -X PUT http://localhost:8080/kinconecta/api/user/John_Doe_123 \
  -H "Content-Type: application/json" \
  -d '{
    "fullName": "John Updated Doe",
    "email": "[email protected]",
    "accountStatus": "ONLINE",
    "updatedAt": "2024-03-10T15:00:00Z"
  }'
Endpoint: PUT /kinconecta/api/user/{fullName}_{userId}
fullName
string
required
User’s full name (used in URL path)
userId
long
required
User’s unique identifier
user
object
required
User object with fields to update (same structure as Create User)
response
object
Updated user object

Delete User

Delete a user from the system.
curl -X DELETE http://localhost:8080/kinconecta/api/user/John_Doe_123
Endpoint: DELETE /kinconecta/api/user/{fullName}_{userId}
fullName
string
required
User’s full name (used in URL path)
userId
long
required
User’s unique identifier
response
object
Deleted user object

Notifications

Add Notification

Add a notification to a user’s account.
curl -X POST http://localhost:8080/kinconecta/api/user/123/add-notification \
  -H "Content-Type: application/json" \
  -d '{
    "type": "booking",
    "title": "New Booking Request",
    "body": "You have a new booking request from John Doe",
    "relatedEntityType": "BOOKING",
    "relatedEntityId": 456,
    "idRead": false,
    "createdAt": "2024-03-10T14:00:00",
    "readAt": null
  }'
Endpoint: POST /kinconecta/api/user/{userId}/add-notification
userId
long
required
User’s unique identifier
type
string
required
Notification type (e.g., “booking”, “message”, “review”)
title
string
required
Notification title
body
string
required
Notification message body
Type of related entity (e.g., “BOOKING”, “MESSAGE”)
ID of the related entity
idRead
boolean
Whether the notification has been read
createdAt
datetime
Notification creation timestamp
readAt
datetime
Timestamp when notification was read (null if unread)
response
object
Updated user object with the new notification added

Build docs developers (and LLMs) love