Back to top

AcrossTheLake API

AcrossTheLake API is the backend to the AcrossTheLake app.

The AcrossTheLake app is a fun app that allows you to take a picture of a house, find the statistics of that house, and surrounding houses and save that to your profile. You can use this app as a visitor but note that unless you sign up/sign in your profile will not be saved.

The general status messages are as follows.

  • 200 - OK

  • 201 - Created

  • 400 - Bad Request (Client Error) - A json with an error array more details should return to the client.

  • 401 - Unauthorized

  • 500 - Internal Server Error - A json with an error should return to the client only when there is no security risk by doing that.

For 400 errors we return the message as well as the specific error in an array of strings.

Landing Page View Controller

This is the landing page view for the user when they first start the app. If there is an error a dialogue box will appear saying they could not be logged in.

Generic Session

Create a new session
623-451-3232/v1/sessions

Create a session by sending a post value with the username (e-mail) and password

  • email (string) - The e-mail of the user

  • password (string) - The password of the user

Example URI

POST /api.acrossthelake.life/v1/sessions
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "email": "test@test.com",
  "password": "test"
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
    "uuid": "<user uuid>",
    "message": "User found.",
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User not found.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Sign Up View Collection

This is for the user to sign up. Once the user signs up they are taken to the main view controller.

Generic User

Create a new user
865-558-2139/v1/users

Create a new user based on the first name, last name, password

  • first_name (string) - The first name of the user

  • last_name (string) - The last name of the user

  • email (string) - The email of the user

  • password (string) - The password of the user

Example URI

POST /api.acrossthelake.life/v1/users
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "first_name": "first",
  "last_name": "last",
  "email": "test@test.com",
  "password": "test"
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "uuid": "<user uuid>",
  "message": "User created."
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User could not be created.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Specific User

Get a user
GET/v1/users/{uuid}

Get the user’s information by their UUID

Example URI

GET /api.acrossthelake.life/v1/users/uuid
URI Parameters
HideShow
uuid
string (required) 

UUID of the user

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User found.",
  "first_name": "First",
  "last_name": "Last",
  "email": "test@test.com",
  "uuid": "<user uuid>"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User not found.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Save a temporary user
POST/v1/users/{uuid}

Save the user based on the current UUID as well as what information they entered into the Signup page

  • first_name (string) - The first name of the user

  • last_name (string) - The last name of the user

  • email (string) - The email of the user

  • password (string) - The password of the user

Example URI

POST /api.acrossthelake.life/v1/users/uuid
URI Parameters
HideShow
uuid
string (required) 

UUID of the user

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "first_name": "first",
  "last_name": "last",
  "email": "test@test.com",
  "password": "test"
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "uuid": "<user uuid>",
  "message": "User saved."
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "User could not be saved.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

House View Controller

This view is for the house, both main house and surrounding houses.

Specific Address House View

Get the house given the address

Get house
GET/v1/addresses/{uuid}/houses

Example URI

GET /api.acrossthelake.life/v1/addresses/uuid/houses
URI Parameters
HideShow
uuid
string (required) 

UUID of the house

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "House found",
  "price": 999999999.99,
  "address": "2380 Island Drive",
  "city": "Spring Park",
  "state": "MN",
  "lat": 99.99999999999999,
  "long": 99.99999999999999,
  "sqft": 999999999,
  "bedrooms": 999999999,
  "bathrooms": 999999999,
  "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum",
  "owner_loves": [
    "Sed ut perspiciatis unde omnis iste natus error sit voluptatem",
    "accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo",
    "inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo."
  ],
  "surrounding_houses": [
    {
      "address": "2390 Island Drive",
      "city": "Spring Park",
      "state": "MN",
      "image_url": "/<image url>.jpg",
      "bedrooms": 999,
      "bathrooms": 999,
      "price": 999999999.99,
      "uuid": "<surrounding house uuid>"
    }
  ],
  "images": [
    "/<image url 1>.jpg",
    "/<image url 2>.jpg"
  ],
  "url": "/pariatur/uuid"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No house with that ID found.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Delete house
DELETE/v1/addresses/{uuid}/houses

Example URI

DELETE /api.acrossthelake.life/v1/addresses/uuid/houses
URI Parameters
HideShow
uuid
string (required) 

UUID of the house

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "House deleted."
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No house with that ID found.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Surrounding Houses View Controller

This is to display a list of surrounding houses. Each house will be linked to the house view controller via their address uuid.

Specific Address Surrounding House

Get a list of surrounding houses given the address

Get surrounding houses
5197314833/v1/addresses/{uuid}/surrounding_houses

Example URI

GET /api.acrossthelake.life/v1/addresses/uuid/surrounding_houses
URI Parameters
HideShow
uuid
string (required) 

UUID of the address

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
    "message": "Surrounding houses found.",
    "houses": [
        { "address": "2390 Island Drive", "city": "Spring Park", "state": "MN", "image_url": "/<some url>/<some image>.jpg", "lat": 99.99999999999999, "long": 99.99999999999999, uuid: "<uuid of the address>" }
    ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No surrounding houses exist.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Main View Controller

This is the main view that a user finds the houses they took a picture of. Both users who have not signed in / up (visitors) as well as those signed in.

Specific User Main

Get the list of searches, or create a search based on the user’s UUID

Create house search
(704) 293-2099/v1/users/{uuid}/main_views

  • lat (decimal) - The latitude of the user’s current location

  • long (decimal) - The longitude of the user’s current location

  • bearing (decimal) - The bearing of the user’s current location.

  • image_url (string) - The url of the uploaded photo to AWS

Example URI

POST /api.acrossthelake.life/v1/users/uuid/main_views
URI Parameters
HideShow
uuid
string (required) 

UUID of the house

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "lat": 99.99999999999999,
  "long": 99.99999999999999,
  "bearing": 999.999999999,
  "image_url": "/<some url>/image.jpg"
}
Response  201
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "<Search created.>|<We could not find a house for the address.>|<We found a house for that address.>",
  "search_uuid": "<uuid of the resulting search>"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Unable to create a search.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Get searches by user UUID
GET/v1/users/{uuid}/main_views

Example URI

GET /api.acrossthelake.life/v1/users/uuid/main_views
URI Parameters
HideShow
uuid
string (required) 

UUID of the user

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "Found searches.",
  "searches": [
    {
      "house_number": "4230",
      "street": "Lindsey Ln",
      "city": "Minnetonka",
      "lat": "44.9262021622108",
      "long": "-93.5107013025261",
      "image_url": null,
      "sqft": "16552.0",
      "bedrooms": "5.0",
      "bathrooms": "6.0",
      "price": null,
      "message": "<A house could not be found but we found an address.>|<A house was located at that address.>"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "No searches exist.",
  "errors": [
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
    "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
  ]
}

Generated by aglio on 14 Mar 2018