Base URL: https://rbeerma-shoppinglist.azurewebsites.net
GET
/api/shoppinglists
(returns all shopping lists in the database)
None
http code | content-type | response |
---|---|---|
200 |
application/json |
<userID>, <list<item>> |
https://rbeerma-shoppinglist.azurewebsites.net/api/shoppinglists
[
{
"userID": "cooper",
"list": [
{
"id": 1,
"name": "dog biscuits",
"quantity": 42,
"checked": false
},
{
"id": 2,
"name": "dog food",
"quantity": 1,
"checked": true
},
{
"id": 3,
"name": "Fresh Pet",
"quantity": 1000,
"checked": false
},
{
"id": 4,
"name": "Toys!",
"quantity": 5,
"checked": false
}
]
},
{
"userID": "rbeerma",
"list": [
{
"id": 1,
"name": "Milk",
"quantity": 1,
"checked": true
},
{
"id": 2,
"name": "coffee",
"quantity": 5,
"checked": false
},
{
"id": 3,
"name": "Donuts",
"quantity": "13",
"checked": true
}
]
}
]
GET
/api/shoppinglists
(returns one shopping list, by user ID)
userID
http code | content-type | response |
---|---|---|
200 |
application/json |
<list> |
https://rbeerma-shoppinglist.azurewebsites.net/api/shoppinglists?userID=cooper
[
{
"id": 1,
"name": "dog biscuits",
"quantity": 42,
"checked": false
},
{
"id": 2,
"name": "dog food",
"quantity": 1,
"checked": true
},
{
"id": 3,
"name": "Fresh Pet",
"quantity": 1000,
"checked": false
},
{
"id": 4,
"name": "Toys!",
"quantity": 5,
"checked": false
}
]
POST
/api/shoppinglists
(saves a shopping list to the database)
None
userID: string
list: array of type 'item'
item:
id: int
name: string
quantity: int
checked: boolean
{
"userID": "cooper",
"list": [
{
"id": 1,
"name": "dog biscuits",
"quantity": 42,
"checked": false
},
{
"id": 2,
"name": "dog food",
"quantity": 1,
"checked": true
},
{
"id": 3,
"name": "Fresh Pet",
"quantity": 1000,
"checked": false
},
{
"id": 4,
"name": "Toys!",
"quantity": 5,
"checked": false
}
]
}
http code | content-type | response |
---|---|---|
200 |
application/json |
<acknowledgement> |
{
"acknowledged": true,
"modifiedCount": 0,
"upsertedId": null,
"upsertedCount": 0,
"matchedCount": 1
}