-
Notifications
You must be signed in to change notification settings - Fork 9
API
Ralph Plumley edited this page Jan 16, 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 |
username | The name of the user creating the listing | String | Gerty Smith | true |
The email address of the user that created the listing | String | [email protected] | true | |
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": "[email protected]",
"zipCode": "52645",
"legoSetCode": "4D1F56",
"imageUrl": "http://aws.com/bucket/images/listing/1/3.jpg"
}
status: 200
{
"_id" : "5a5d4b287a813f83b4332760",
"title" : "Batman Beyond",
"description" : "Batman Beyond set",
"condition" : "used",
"category" : "batman",
"username" : "Gerty Smith",
"email" : "[email protected]",
"zipCode" : "55105",
"legoSetCode" : "13452",
"imageUrl" : "",
"createdAt" : "2018-01-16T00:45:28.919Z",
"__v" : 0
}
/listings GET returns an array of listings. The results can be filtered by _id, category, zip code, or legoSetCode
param | description | data type | examples | required |
---|---|---|---|---|
_id | The id of the listing | String | 5a590b8868bfac731cec4d85 | false |
category | The category name from the manufacturer | String | Star Wars | false |
zipCode | The zip code of where the lego sets are located | String | 20000 | false |
legoSetCode | The Lego set code for the listing | String | P42F36 | false |
"http://localhost:8080/listings/?_id=5a5d4b287a813f83b4332760"
status: 200
[
{
"_id": "5a590b8868bfac731cec4d85",
"title": "Star Wars Boba Fett",
"description": "Brand new. My kid wanted Batman.",
"condition": "New",
"category": "Star Wars",
"username": "SuburbanDad",
"email": "[email protected]",
"zipCode": "52645",
"legoSetCode": "4D1F56",
"imageUrl": "http://aws.com/bucket/images/listing/1/3.jpg",
"__v": 0,
"createdAt": "2018-01-12T19:24:56.463Z"
}
]
"http://localhost:8080/listings/?category=Star+Wars"
status: 200
[
{
"_id": "5a590b8868bfac731cec4d85",
"title": "Star Wars Boba Fett",
"description": "Brand new. My kid wanted Batman.",
"condition": "New",
"category": "Star Wars",
"username": "SuburbanDad",
"email": "[email protected]",
"zipCode": "52645",
"legoSetCode": "4D1F56",
"imageUrl": "http://aws.com/bucket/images/listing/1/3.jpg",
"__v": 0,
"createdAt": "2018-01-12T19:24:56.463Z"
},
{
"_id": "5a590b4868bfac731cec4d84",
"title": "Star Wars Luke's Island",
"description": "Brand new. My kid wanted Batman.",
"condition": "New",
"category": "Star Wars",
"username": "SuburbanDad",
"email": "[email protected]",
"zipCode": "52645",
"legoSetCode": "444F56",
"imageUrl": "http://aws.com/bucket/images/listing/1/2.jpg",
"__v": 0,
"createdAt": "2018-01-12T19:23:52.845Z"
}
]