Skip to content

API Documentation

Edgar Ulloa edited this page Nov 15, 2022 · 23 revisions

USER AUTHORIZATION

/me

  • GET: Returns current user's information
  • PUT: Updates a user's information
  • DELETE: Deletes current user

/login

  • POST: Logs in user with valid credentials and returns current user's information

/signup

  • POST: Creates a new user, logins in user, and returns current user's information

LISTINGS

/listings

  • GET: Return all listings
  • POST: Create a new listing

/me/listings

  • GET: Return all current user listings

/listings/<int:listing_id>

  • GET: Return a listing
  • PUT: Update a listing
  • DELETE: Delete a listing

TOURS

/tours

  • GET: Return all tours

/me/tours

  • GET: Return all current user's tours

/listings/<int:listing_id>/tours

  • POST: Create a new tour

/tours/<int:tour_id>

  • GET: Return a tour
  • PUT: Update a tour
  • DELETE: Delete a tour

OFFERS

/offers

  • GET: Return all offers

/me/offers

  • GET: Return all current user offers

/listings/<int:listing_id>/offers

  • POST: Create a new offer

/offers/<int:offer_id>

  • PUT: Update an offer
  • DELETE: Delete an offer

FAVORITES

/favorites

  • GET: Return all favorites

/me/favorites

  • GET: Return all current user favorite listings

/listings/<int:listing_id>/favorites

  • POST: Creates a new favorite listing

/me/favorites/<int:favorite_id>

  • GET: Return a favorite listing
  • DELETE: Delete a favorite listing

IMAGES

/images

  • GET: Return all images

/me/images

  • GET: Return all current user images

/listings/<int:listing_id>/images

  • POST: Creates a new listing image

/images/<int:image_id>

  • GET: Return an image
  • DELETE: Delete an image