Backend Repository of Project for CS407 Fall 2018
Cory Laker, Geoffrey Myers, Pranav Vasudha, Ryan Walden, Vedant Nevetia, Zachary Rich
-
/user
: Create new user- Type: POST
- Request Body Parameters
email
: User emailname
: User namepasswd
: User passwordis_company
: Is user a company? ('f' for user, 't' for company)
-
/company
: Create new company- Type: POST
- Request Body Parameters
email
: Company emailname
: Company namepasswd
: Company passwordis_company
: Is user a company? ('f' for user, 't' for company)
- Request Body Parameters
- Type: POST
-
/signin
: Sign in user/company- Type: POST
- Request Body Parameters
email
: User/Company emailpasswd
: User/Company password
- Returns
token
response containing a JSON Web Token
-
/user/{id}/delete
: ADMIN ROUTE: Deletes a user from database- Type: GET
- GET request accepts a user ID in the URL and deletes that user and all listings, etc. associated with that user's ID if found
-
/user/{id}/ban
: ADMIN ROUTE: Bans a user from Recyclr- Type: GET
- GET request accepts a user ID in the URL and bans the user from Recyclr. Authentication with the same URL will fail henceforth
-
/user/{id}
: Update user- Type: PUT
- Request Body Parameters
email
: New user emailpasswd
: New user passwordaddress
: New user addressname
: New user name
- Can send in only the parameters which need to be updated, not all
-
/user/{id}
: Get user- Type: GET
- Returns relevant user information based if user with
id
is found
-
/user/progress/{id}
: Get user's recycling progress- Type: GET
- Returns user's recycling progress
-
/user/delete
: Delete user's profile NOT IMPLEMENTED- Type: POST
- Request Body Parameters
-
/user/logout
: Logout the user- Type: POST
- Request Body Parameters
user_id
: ID of the user
-
/companies
: Get all companies registered in DB- Type: GET
-
/company/{id}
: Get company account information associated with ID- Type: GET
- Returns company account associated with
id
-
/company/delete
: Delete company's profile NOT IMPLEMENTED- Type: POST
- Request Body Parameters
-
/listings
: Get all listings- Type: GET
- Returns all listings in the database
-
/listing/{id}
: Get listing associated with ID- Type: GET
- Returns listing information associated with
id
-
/listing
: Create a new listing- Type: POST
- Request Body Parameters
title
: string: Listing titledescription
: string: Listing description
material_type
: string: Type of material being recycled (hopefully will be from a constant set of strings so we can filter by a particular type of material in the database)material_weight
: float: Weight of the material being recycleduser_id
: integer: ID of the user creating the listing
-
/listing/{id}/update
: Update an existing listing-
Type: POST
-
Request parameters
id
: ID of the listing being updated
-
Request Body Parameters
title
: New titledescription
: New descriptionmaterial_weight
: New material weightmaterial_type
: New material typeis_active
: 'f' if order was purchased, 't' if order is still activepickup_date_time
: Date and time for pickup in case order was placed
-
Returns a status code indicating success or failure
-