Skip to content
Jeffrey Leung edited this page Feb 23, 2019 · 10 revisions

Create a Give

Description

Creates a new Give for a given user.

Does not need to be unique.

Example script to call the API

Request

Method

POST

Mapping

/give

JSON Body

{
  "user_name": String,
  "user_email": String,
  "user_location": String,
  "item": String,
  "quantity": Number
}

Response

Codes

HTTP Status Code Meanings
201 Created Created the Give succesfully
500 Internal Server Error The server crapped itself

JSON body

{
  "id": String UUID
}

Retrieve all Gives

Description

Returns all Gives from all users.

If the Give has been matched or fulfilled, it will have the ID of the corresponding match as well as the name, email, and location of the match.

Example script to call the API

Request

Method

GET

Mapping

/give

Response

Codes

HTTP Status Code Meanings
200 OK Retrieved all Gives successfully
500 Internal Server Error The server crapped itself

JSON body

[ array
  {
    "posted": Number (Unix timestamp)
    "id": String UUID,
    "user_name": String,
    "user_email": String,
    "user_location": String,
    "item": String,
    "quantity": Number,
    "status": String,
    "match_id": String (Optional),
    "match_name": String (Optional),
    "match_email": String (Optional),
    "match_location": String (Optional)
  }
]

For the possible values of status, see Values.

Clone this wiki locally