Skip to content

API routing

Henrique Pereira edited this page Dec 8, 2020 · 2 revisions

Global (don't need authentication):

Authentication:

  • api/auth/login/ - Given username and password, returns the authentication token for that user if exists
  • api/auth/signup/ - Given username, email, password, first_name and last_name, creates a new user and returns its authentication token

Protected (need authentication - "Authorization: Token <your_token>"):

Loan Requests:

  • api/loanrequests/new/ - Given school, course and amount, creates a new Loan Request for the authenticated user
  • api/loanrequests/get_personal/ - Returns Loan Requests created by the authenticated user
  • api/loanrequests/get_all/ - Returns all the active Loan Requests created by all the users
  • api/loanrequests/get/<int:id>/ - Returns the Loan Request for the given ID
  • api/loanrequests/get/<int:id>/investments/ - Returns the Investments for a given Loan Request

Investments:

  • api/investments/new/ - Given request (Loan Request ID) and amount, creates a new Investment for the authenticated user related to the given Loan Request
  • api/investments/get_personal/ - Returns the Investments made by the authenticated user
  • api/investments/get/<int:id>/ - Returns the Investment with the given ID

Clone this wiki locally