Unreal Estate
Unreal Estate is a simple RESTful web app that allows the user to find Real Estate listings they might be interested in. Unreal Estate is built on Laravel 5 and PHP 7.
Listing Updates
The application maintains its own database of real estate listings. These listings are updated daily (2:00AM EST) from an external source.
API Usage
There are two endpoints available for reading listing data, and one endpoint for modifying listing data.
Get All Listings
Retrieves all listings as an array of JSON objects
- URL
/listings
- Method
GET
- Success Response
- Code: 200
- Content:
{ [ {
}, ... ] }
Get Paginated Listings
Retrieves a partial collection of all listings as an array of JSON objects. Sorting, filtering, and pagination is done via query parameters.
- URL
/paginated_listings
- Method
GET
- URL Parameters All parameters are optional, some have default values if not specified
Parameter | Description | Allowed Values | Default |
---|---|---|---|
page | specifies the page to show | any positive, non-zero integer | 1 |
results_per_page | specifies the number of results to show per page | any positive, non-zero integer | 1 |
photos_only | returns only photos from the listings | true or false |
false |
sort | specifies how to sort the returned listings | Sorting Expression, only list_price and listing_date fields |
none |
if no sorting is specified, no sorting will be explicitly applied and there are no guarantees what order the results will be in
- Success Response
- Code: 206
- Content:
{ [ {
}, ... ] }
- Error Responses
- Errors in URL parameters
- Code: 400
- Content:
{ "error": "there was an error with the query parameters" }
- No data for given pagination parameters
- Code: 404
- Content: none
- Errors in URL parameters
Toggle Listing Activation
Allows user to activate or deactivate a listing. The behavior of this endpoint is toggling, so calling the endpoint when the listing is inactive will activate it, and vice-versa.
The endpoint also returns the representation of the affected listing as a JSON object.
- URL
/listings/:id/toggle_activation
- Method
PUT
- Success Response
- Code: 200
- Content:
{
}
- Error Responses
- No Listing for id
- Code: 404
- Content: none
- No Listing for id