Skip to content

Backend Routes

HammadKhalid101 edited this page Mar 22, 2021 · 9 revisions

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • POST /api/users - Sign Up

session

  • POST /api/session - Log In
  • DELETE /api/session - Logout

assets

  • GET /api/users/:user_id/assets - returns the user's entire assets (portfolio)
  • POST /api/users/:user_id/assets - adds a stock/crypto to user's assets (portfolio)
  • GET /api/users/:user_id/assets/:id - returns the specified stock/crypto from user's assets (portfolio)
  • PATCH /api/users/:user_id/assets/:id - updates the specified stock/crypto from user's assets (portfolio)
  • DELETE /api/users/:user_id/assets/:id - deletes the specified stock/crypto from user's assets (portfolio)

stocks

  • GET /api/stocks/:id - returns the stock/crypto information

trades

  • POST /api/trades/:id - buy or sell a stock/crypto

watchlist

  • POST /api/watchlist - creats a watchlist for user
  • GET /api/watchlist/:id - returns the user's entire watchlist
  • POST /api/watchlist/:id - updates a user's watchlist (add/delete stocks or cryptos from watchlist)
  • DELETE /api/watchlist/:id - deletes a watchlist for user
Clone this wiki locally