About


The AirBNC API is a RESTful API designed for interacting with the AirBNC backend.


It provides structured access to core resources such as properties, reviews, users, and favourites. Built following REST conventions, this API allows the frontend application to securely fetch, create, update, and delete data from the database. It’s designed for reliability, scalability, and ease of integration.

Endpoints


Overview


The following endpoints provide structured access to key resources within the AirBNC platform, including properties, reviews, users, and favourites. Each endpoint follows RESTful conventions and supports standard HTTP methods for interacting with the backend service. These routes are designed to allow the frontend to fetch, create, update, and delete data securely and efficiently. All responses are returned in JSON format, and appropriate status codes are used to indicate success or failure.

Properties


GET - Properties

https://airbnc-backend.kieranobrien.dev/api/properties{?=optionalQueries}

Returns all details for filtered properties. Can be filtered using any combination of the optional queries listed below. Default sorting is descending by popularity.

Optional Queries -

Success -

200

GET - Property

https://airbnc-backend.kieranobrien.dev/api/properties/{propertyId}{?=optionalQuery}

Returns all details for a single property, specified by it's property id. Can be passed an optional query of a user id. If passed this query, the returned "property" object will have an additional "favourited" key with a boolean value, indicating whether the specified user has favourited the specified property.

Optional Query -

Success -

200

Reviews


GET - Reviews

https://airbnc-backend.kieranobrien.dev/api/properties/{propertyId}/reviews

Fetches all reviews for a property, specified by it's property id.

Success -

200

POST - Review

https://airbnc-backend.kieranobrien.dev/api/properties/{propertyId}/reviews

Posts a review for a property, specified by it's property id. Expects correct payload.

Expected Payload -

Success -

201

DELETE - Review

https://airbnc-backend.kieranobrien.dev/api/reviews/{reviewId}

Deletes a review for a property, specified by it's review id.

Success -

204

Users


GET - User

https://airbnc-backend.kieranobrien.dev/api/users/{userId}

Fetches all details of a user, specified by their user id.

Success -

200

PATCH - User Details

https://airbnc-backend.kieranobrien.dev/api/users/{userId}

Updates the details for a single users' details, specified by their user id. Expects correct payload.

Expected Payload (Any combination of keys listed below) -

Success -

200

Favourites


POST - Favourite

https://airbnc-backend.kieranobrien.dev/api/properties/{propertyId}/favourite

Posts a user favourite for a property, specified by the property id. Expects payload of guest id.

Expected Payload -

Success -

201

DELETE - Favourite

https://airbnc-backend.kieranobrien.dev/api/properties/{propertyId}/users/{userId}/favourite

Deletes a users' favourite for a specified property, requires both a property id and a user id.

Success -

204

Try It Out


Use the GET Tester below to manually query any public GET endpoint on the AirBNC API. Simply enter a valid endpoint URL and view the formatted JSON response directly in the browser. This tool is intended for quick testing and exploration of available data.

GET

https://airbnc-backend.kieranobrien.dev/api/