Welcome to Trippins API
The Trippins API is a REST-based service that powers the hotel booking platform. It provides programmatic access to manage users, houses, reservations, reviews, and all core booking operations.Base URL and Versioning
All API requests are made to the following base URL:/v1/api:
Example Endpoints
https://localhost:8443/v1/api/houses- List all houseshttps://localhost:8443/v1/api/users- Manage usershttps://localhost:8443/v1/api/reservations- Handle reservations
API Architecture
The Trippins API follows RESTful principles with resource-based URLs and standard HTTP methods:| Method | Description |
|---|---|
GET | Retrieve resources |
POST | Create new resources |
PUT | Update existing resources |
DELETE | Remove resources |
Resource Categories
The API is organized into the following resource groups:User Management
Create, read, update, and delete user accounts
Housing Management
Manage hotel listings, tags, and properties
Reservation Management
Handle booking operations and availability
Review Management
Manage customer reviews and ratings
Authentication
JWT-based authentication and authorization
Advanced Search
Query houses by tags and star ratings
Response Format
All API responses return JSON-formatted data with consistent structure.Success Response
Successful requests return the appropriate HTTP status code and JSON payload:Common HTTP Status Codes
The request succeeded. Response includes the requested data.
A new resource was successfully created.
The request succeeded but there’s no content to return (typically for DELETE operations).
The request was malformed or contains invalid parameters.
Authentication is required or credentials are invalid.
The authenticated user doesn’t have permission to access this resource.
The requested resource doesn’t exist.
An unexpected error occurred on the server.
Error Handling
When an error occurs, the API returns a structured error response:Error Response Format
Error Response with Problem Details
For some endpoints, detailed error information follows RFC 7807 Problem Details:A URI reference identifying the problem type
A short, human-readable summary of the problem
The HTTP status code
A detailed explanation of the problem
The URI reference of the specific occurrence
Authentication Overview
Most API endpoints require authentication using JWT (JSON Web Tokens). See the Authentication page for complete details on:- Logging in to obtain a JWT token
- Including the token in API requests
- Token expiration and renewal
- Role-based access control
Quick Authentication Example
Rate Limiting
Currently, the Trippins API does not implement rate limiting. However, clients should implement reasonable request throttling to avoid overloading the server.
- Avoid making excessive concurrent requests
- Implement exponential backoff for retries
- Cache responses when appropriate
Pagination
Certain endpoints support pagination for large result sets:Pagination Parameters
Zero-based page number
Number of items per page
Pagination Example
Pagination Response
The array of items for the current page
Total number of pages available
Total number of items across all pages
Current page number (zero-based)
Whether this is the first page
Whether this is the last page
Content Types
The API accepts and returns JSON data. Always include the appropriate headers:Image Endpoints
Housing image endpoints work with binary image data:Getting Started
To begin using the Trippins API:- Authenticate: Obtain a JWT token via the
/v1/api/loginendpoint - Include Token: Add the token to the
Authorizationheader of all requests - Make Requests: Use standard HTTP methods to interact with resources
- Handle Responses: Process JSON responses and handle errors appropriately
Next: Authentication
Learn how to authenticate with JWT tokens
