Public
Documentation Settings

Silent Auction API

API for Silent Auction build week project

Auction Endpoints

Auctions are linked to a seller. They contain a name, a unique ID, the time the auction will end, and the ID of the linked seller.

GETGet All Auctions

https://api-silent-auction.herokuapp.com/api/auction

Gets all auctions from the database. Returns an array of auction objects with the following schema:

Plain Text
{
    "id": 1,
    "name": "Nancy's Yard Sale",
    "end_time": "2020-05-25 16:30:00",
    "seller_id": "2d0f7c4c-fd2a-45bf-8fca-035890866996"
}
Example Request
curl
curl --location 'https://api-silent-auction.herokuapp.com/api/auction'
200 OK
Example Response
json
{
  "data": [
    {
      "id": 1,
      "name": "Nancy's Yard Sale",
      "end_time": "2020-05-25 16:30:00",
      "seller_id": "2d0f7c4c-fd2a-45bf-8fca-035890866996"
    },
    {
      "id": 2,
      "name": "Girl Scout Troop #2213 Fundraiser",
      "end_time": "2020-06-13 18:00:00",
      "seller_id": "dfe87610-8b86-4f71-835f-54b9ebf2b123"
    }
  ]
}
Server

Cowboy

Connection

keep-alive

X-Dns-Prefetch-Control

off

X-Frame-Options

SAMEORIGIN

Strict-Transport-Security

max-age=15552000; includeSubDomains

X-Download-Options

noopen

X-Content-Type-Options

nosniff

X-Xss-Protection

1; mode=block

Access-Control-Allow-Origin

*

Content-Type

application/json; charset=utf-8

Content-Length

266

Etag

W/"10a-tBKaXIsIE4kDhqiGdmCxV5I5HQo"

Date

Wed, 29 Apr 2020 17:17:05 GMT

Via

1.1 vegur

GETGet Auction By ID

https://api-silent-auction.herokuapp.com/api/auction/:id

Gets the auction matching the ID in the URL. Returns a single auction object.

PATH VARIABLES
id

1

Example Request
curl
curl --location 'localhost:5000/api/auction/1'
200 OK
Example Response
json
{
  "data": {
    "id": 1,
    "name": "Nancy's Yard Sale",
    "end_time": "2020-05-25 16:30:00",
    "seller_id": "2d0f7c4c-fd2a-45bf-8fca-035890866996"
  }
}
X-DNS-Prefetch-Control

off

X-Frame-Options

SAMEORIGIN

Strict-Transport-Security

max-age=15552000; includeSubDomains

X-Download-Options

noopen

X-Content-Type-Options

nosniff

X-XSS-Protection

1; mode=block

Access-Control-Allow-Origin

*

Content-Type

application/json; charset=utf-8

Content-Length

128

ETag

W/"80-v/MZPT5M6NoeZ4A0Jm14dikGdLw"

Date

Wed, 29 Apr 2020 18:19:27 GMT

Connection

keep-alive

POSTPost an Auction

https://api-silent-auction.herokuapp.com/api/auction/

Adds an auction to the database. Required parameters are:

  • "name" as a string. Must be unique.
  • "end_time" in format YYYY-MM-DD HH:MM:SS.
  • "seller_id" as a string, which should be an existing seller.
Bodyraw (json)
json
{
	"end_time": "2020-05-30 14:57:00",
	"seller_id": "2d0f7c4c-fd2a-45bf-8fca-035890866996"
}
Example Request
curl
curl --location 'https://api-silent-auction.herokuapp.com/api/auction/' \
--data '{
	"end_time": "2020-05-30 14:57:00",
	"seller_id": "2d0f7c4c-fd2a-45bf-8fca-035890866996"
}'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

PUTUpdate an Auction

https://api-silent-auction.herokuapp.com/api/auction/:id

Updates an auction in the database. You can send just the data that needs to be updated or the whole object, the choice is yours. Updateable paramaters are:

  • "name" as a string. Must be unique.
  • "end_time" in format YYYY-MM-DD HH:MM:SS.
  • "seller_id" as a string, which should be an existing seller.
PATH VARIABLES
id

1

Bodyraw (json)
json
{
	"end_time": "2020-06-01 500:00:00"
}
Example Request
curl
curl --location --request PUT 'https://api-silent-auction.herokuapp.com/api/auction/1' \
--data '{
	"end_time": "2020-06-01 500:00:00"
}'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers