API link: https://silent-auction-bw.herokuapp.com/ Documentation: https://silent-auction-bw.herokuapp.com/apidoc/
Repository: https://github.com/jordandoan/silent-auction Deployment: https://silent-auction-jd.netlify.app/
Method Type | Resource Type | Route | Description | Parameters/Body Request | Response |
---|---|---|---|---|---|
POST | Create | /register | Register a user | username: String password: String first_name: String last_name: String (optional) is_seller: Boolean (defaults to false) |
id number |
POST | Create | /login | Login. Returns token if successful | username: String password: String |
Method Type | Resource Type | Route | Description | Parameters/Body Request | Response |
---|---|---|---|---|---|
GET | Request | / | Request user information and auctions associated with user. Seller: Auctions that user has posted. Buyer: Auctions that user has bid on. |
None | User information |
Method Type | Resource Type | Route | Description | Parameters/Body Request | Response |
---|---|---|---|---|---|
GET | Request | / | Request information for all auctions | None | Array Auction info: Auction seller info Auction name, description start and end dates starting price URL to image. Bids Date, price, and user who placed bid |
GET | Request | /:id | Request information for a specific auction | id: Auction id | Same as above |
POST | Create | / | Create an auction | Requires the seller role name: String description: String (optional) date_starting: Date date_ending: Date image: String |
id of auction |
PUT | Update | /:id | Edit an auction | Same as above. Only description and date_ending can be edited after a bid has been placed on an auction | number of records updated |
DELETE | Delete | /:id | Delete an auction | None |
Method Type | Resource Type | Route | Description | Parameters/Body Request | Response |
---|---|---|---|---|---|
GET | Request | /:id | Request information for a specific bid | id: Bid id | User info (username and first name) Price of bid Date bid was placed |
POST | Create | /:auction_id | Places a bid on auction with specified ID. Must be placed on an active auction and bid must be higher than the current price | Params: auction_id: Auction id Request: Requires the buyer role price: Integer |
id of bid |
PUT | Update | /:id | Edit a bid. Must be the most recent bid | Params: id: Bid id Request: price: Integer |
number of records updated |
DELETE | Delete | /:id | Delete a bid. Must be the most recent bid | id: Bid id | number of records deleted |