Hosted at https://bw-silent-auction-1.herokuapp.com/
Method | Endpoint | Need Auth? | Description |
---|---|---|---|
GET | / | no | API sanity check |
POST | /api/auth/register | no | adds new user to the database and returns token |
POST | /api/auth/login | no | returns a token |
GET | /api/auctions | yes | returns all active auctions |
GET | /api/auctions/:id | yes | returns an auction matching the id |
POST | /api/auctions | yes, seller | adds a new auction to the database (see auctions schema for required data) |
PUT | /api/auctions/:id | yes, seller | updates auction matching the id (see auctions schema for required data) |
DELETE | /api/auctions/:id | yes, seller | deletes auction matching the id |
GET | /api/bids | yes | returns all bids |
GET | /api/bids/:id | yes | returns all bids for the auction matching the id |
POST | /api/bids/:id | yes, bidder | adds a new bid the auction matching the id |
POST | /api/payments | no | submits payment information |
Field | Data Type | Metadata |
---|---|---|
id | unsigned integer | primary key, auto-increments, generated by database |
username | string | required, unique |
password | string | required |
user_type | string | required, two types: seller and bidder |
Field | Data Type | Metadata |
---|---|---|
id | unsigned integer | primary key, auto-increments, generated by database |
name | string | required |
image | string | required |
description | string | required |
starting_price | unsigned integer | required |
deadline | datetime | required |
user_id | unsigned integer | required, foreign key referencing users.id |
Field | Data Type | Metadata |
---|---|---|
id | unsigned integer | primary key, auto-increments, generated by database |
user_id | unsigned integer | required, foreign key referencing users.id |
auction_id | unsigned integer | required, foreign key referencing auctions.id |
amount | unsigned integer | required |