-
Notifications
You must be signed in to change notification settings - Fork 117
/
API_PLAYGROUND.http
77 lines (55 loc) · 1.98 KB
/
API_PLAYGROUND.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
##############################
# GROCERY ITEM CATEGORIES
##############################
GET https://localhost:3100/api/grocery/categories
##############################
# GROCERY ITEMS
##############################
GET https://localhost:3100/api/grocery/items
###
# By default this returns 10 items, but we can ask for more with the limit queryparam
GET https://localhost:3100/api/grocery/items?limit=2
###
# Or "offset" the list of results (i.e., for pagination)
GET https://localhost:3100/api/grocery/items?offset=10
###
# We can also filter by category
GET https://localhost:3100/api/grocery/items?category=fruit
##############################
# CURRENT SHOPPING CART
##############################
###
# You can set the contents of your shopping cart as follows.
PUT https://localhost:3100/api/cart/items HTTP/1.1
content-type: application/json
{"data":
[
{"groceryItem": { "id": 132 }, "qty": 9},
{"groceryItem": { "id": 134 }, "qty": 2},
{"groceryItem": { "id": 118 }, "qty": 1}
]
}
##############################
# ORDER
##############################
###
# Get a collection of orders in the system
GET https://localhost:3100/api/orders HTTP/1.1
###
# Create a new order. This will result in all cart items being removed
# and a new order being created (and returned)
POST https://localhost:3100/api/order HTTP/1.1
content-type: application/json
{"data":
[
{"groceryItem": { "id": 132 }, "qty": 9},
{"groceryItem": { "id": 134 }, "qty": 2},
{"groceryItem": { "id": 118 }, "qty": 1}
]
}
##############################
# PUSH-SUBSCRIPTION
##############################
POST https://localhost:3100/api/push-subscription HTTP/1.1
content-type: application/json
{"endpoint":"https://fcm.googleapis.com/fcm/send/d5zr78aM0Is:APA91bFsdo7JWQuclBoGdOxnenu…i4CAxUgoSMXYK3khDYnXNYdKD34JSW7gDTfk5rSA_UN7CIjKG5aekHy2UFEWTaN1fsl7gMeN4q","keys":{"p256dh":"BIf4WiWDEnPBluoQaxfyg6JGEX73LIT11tuB9p2MbIQF6paYdDA301gSITCVBjfGpur1v3UfuSsZULYbc1UGOFs=","auth":"5hU-ISOurqOJ6tVEEufUNw=="}}