Repository navigation
API
Patty Kovash edited this page Jan 12, 2018
·
25 revisions
/listings POST
| param | description | data type | examples | required |
|---|---|---|---|---|
| title | The title of the listing | String | City Scapes | true |
| description | The description of the listing | String | A beautiful set from the latest collection... | false |
| condition | The condition of the listing | String | Used | false |
| category | The category of the listing | String | Batman | true |
| The email address of the user that created the listing | String | me@example.com | true | |
| category | The collection name from the manufacturer | String | Star Wars | false |
| zipCode | The zip code of where the lego set is located | String | 20000 | true |
| legoSetCode | The Lego set code for the listing | String | P42F36 | false |
| imageUrl | An image URL of the listing | String | http://aws.com/bucket/images/listing/1/1.jpg | false |
{
"title": "Star Wars Boba Fett",
"description": "Brand new. My kid wanted Batman.",
"condition": "New",
"category": "Star Wars",
"username": "SuburbanDad",
"email": "bob@bob.com",
"zipCode": "52645",
"legoSetCode": "4D1F56",
"imageUrl": "http://aws.com/bucket/images/listing/1/3.jpg"
}
status: 201
{
"listingId": "1234"
}/listings GET
returns an array of listings. The results can be filtered by userId, category, zip code, or legoSetCode
| param | description | data type | examples | required |
|---|---|---|---|---|
| :userId | The id of the user that created the listing | String | 1000 | false |
| category | The category name from the manufacturer | String | Star Wars | false |
| location | The zip code of where the lego sets are located | String | 20000 | false |
| legoSetCode | The Lego set code for the listing | String | P42F36 | false |
{
"userId": "1000"
}status: 200
[
{
"userId": "1000",
"listingId": "1",
"title": "City Scapes",
"description": "A beautiful set from the latest collection...",
"imageUrl": "http://aws.com/bucket/images/listing/1/1.jpg",
"collection": "City",
"location": "2030",
"legoSetCode: "XP#BN2",
"email": "me@example.com",
"createAt:
}
]{
"collection": "Star Wars"
}status: 200
[
{
"userId": "1002",
"listingId": "2",
"title": "Luke",
"description": "Luke Skywalker's...",
"imageUrl": "http://aws.com/bucket/images/listing/1/1.jpg",
"collection": "City",
"location": 2000,
"email": "me2@example.com"
},
{
"userId": "1003",
"listingId": "4",
"title": "Death Star",
"description": "One of the first...",
"imageUrl": "http://aws.com/bucket/images/listing/4/1.jpg",
"collection": "Star Wars",
"location": 2000,
"email": "me2@example.com"
}
]/listings DELETE
| param | description | data type | examples | required |
|---|---|---|---|---|
| :listingId | The id of the listing to be deleted | String | 1000 | true |
{
"listingId": "1000"
}
status: 201