forked from espiers13/hidden-gems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoints.json
212 lines (212 loc) · 7.33 KB
/
endpoints.json
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
{
"GET /api": {
"description": "serves up a json representation of all the available endpoints of the api"
},
"GET /api/users": {
"description": "serves an array of all users",
"queries": ["filter_by = username"],
"exampleResponse": [
{
"user_id": 1,
"name": "John Doe",
"username": "johndoe123",
"email": "[email protected]",
"password": "P@ssw0rd123!",
"avatar_url": "https://firebasestorage.googleapis.com/v0/b/fir-project-28217.appspot.com/o/avatars%2FJohn%20Doe.png?alt=media&token=c19e3cb9-6890-498d-b0be-4ec63e24ed11",
"user_type": "artist"
},
{
"user_id": 2,
"name": "Jane Smith",
"username": "janesmith456",
"email": "[email protected]",
"password": "S3cur3P@ss!",
"avatar_url": "https://firebasestorage.googleapis.com/v0/b/fir-project-28217.appspot.com/o/avatars%2FJane%20Smith.png?alt=media&token=395e8115-f077-40a8-9731-e2cb44641db9",
"user_type": "artist"
}
]
},
"GET /api/users/:user_id": {
"description": "serves a user object by its id",
"queries": [],
"exampleResponse": {
"user_id": 2,
"name": "Jane Smith",
"username": "janesmith456",
"email": "[email protected]",
"avatar_url": "https://firebasestorage.googleapis.com/v0/b/fir-project-28217.appspot.com/o/avatars%2FJane%20Smith.png?alt=media&token=395e8115-f077-40a8-9731-e2cb44641db9",
"user_type": "artist"
}
},
"POST /api/users": {
"description": "accepts an object as a user and adds it to users",
"queries": [],
"accepts": {
"name": "Emily Spiers",
"username": "emilys123",
"user_type": "regular",
"email": "[email protected]",
"password": "testpassword",
"avatar_url": "https://avatar.iran.liara.run/public/59"
},
"exampleResponse": {
"user_id": 5,
"name": "Emily Spiers",
"username": "emilys123",
"user_type": "regular",
"email": "[email protected]",
"password": "testpassword",
"avatar_url": "https://avatar.iran.liara.run/public/59"
}
},
"PATCH /api/users": {
"description": "accepts an object of one or more key-value pairs of updated user information and uses it to update the user",
"queries": [],
"accepts": [
{ "user_type": "artist" },
{ "name": "Michael Brown" },
{ "email": "[email protected]" },
{ "password": "testpassword" },
{ "avatar_url": "https://avatar.iran.liara.run/public/59" }
],
"constraints": "does not accept changes to username",
"exampleResponse": {
"user_id": 3,
"name": "Michael Brown",
"username": "emilys123",
"user_type": "artist",
"email": "[email protected]",
"password": "testpassword",
"avatar_url": "https://avatar.iran.liara.run/public/59"
}
},
"GET /api/comments": {
"description": "serves an array of all comments",
"queries": ["sort_by", "order"],
"exampleResponse": {
"comments": [
{
"username": "emilyd202",
"body": "The Foraging Adventure was such a unique experience! I learned so much about wild edibles. Highly recommend!",
"gem_id": 4,
"date": 1728166800
}
]
}
},
"GET /api/comments/:gem_id": {
"description": "serves an array of all comments for specified gem_id",
"queries": ["sort_by", "order"],
"exampleResponse": {
"comments": [
{
"username": "laurajohn01",
"body": "The City Lights Photography Tour was spectacular! The guide offered amazing tips and I got some incredible shots.",
"gem_id": 6,
"date": 1727622000
}
]
}
},
"POST /api/comments": {
"description": "adds a new comment to specific gem",
"queries": [],
"exampleResponse": {
"comments": [
{
"username": "jamesc890",
"body": "Moonlit Rooftop Bar is a gem! The view of the city skyline at night is stunning and the cocktails are top-notch.",
"gem_id": 9,
"date": 1728330600
}
]
}
},
"DELETE /api/comments/:comment_id": {
"description": "deletes comment by comment_id",
"queries": [],
"exampleResponse": {}
},
"GET /api/gems": {
"description": "provides an array of all gems",
"queries": ["sort_by = date", "order = desc", "category", "date", "type"],
"exampleResponse": [
{
"title": "The Secret Garden Cafe",
"description": "I stumbled upon this little gem while wandering around the neighborhood. The garden patio is such a peaceful escape from the city, and the coffee? Absolutely the best I've had in a long time! The pastries are homemade and pair perfectly with their artisan brews. I'll definitely be back to enjoy more quiet mornings here.",
"category": "food",
"img_url": ["https://firebasestorage.googleapis.com/v0/b/fir-project-28217.appspot.com/o/gems%2Frooftop-bar.jpg?alt=media&token=85c35ee4-006c-4f20-922f-e4e84b205731"],
"latitude": 53.4642,
"longitude": -2.2365,
"address": "12a Levenshulme Rd, Manchester M19 2BA, United Kingdom",
"date": null,
"user_id": 3,
"gem_id": 3,
"type": "place",
"rating": 1.5
}
]
},
"GET /api/gems/:gem_id": {
"description": "serves a gem object by its gem_id",
"queries": [],
"exampleResponse": {
"title": "Foraging Adventure",
"description": "Join a foraging expert on a walk through nature, learning about what you can eat from nature!",
"category": "nature",
"img_url": [
"https://firebasestorage.googleapis.com/v0/b/fir-project-28217.appspot.com/o/gems%2Fforaging-adventure.webp?alt=media&token=5799c51d-0062-457d-9be9-26e2789b76b2"
],
"latitude": 53.40998,
"longitude": -2.231808,
"address": "18 Stenner Ln, Didsbury, Manchester M20 2RQ",
"date": "2023-10-05T07:00:00.000Z",
"user_id": 1,
"gem_id": 2,
"type": "event",
"rating": "2.7"
}
},
"POST /api/gems": {
"description": "accepts an object as a gem and adds it to gems",
"queries": [],
"accepts": {
"title": "Example Event Title",
"description": "Example event description",
"category": "culture",
"img_url": ["https://example-img-url.com/"],
"latitude": 53.4783,
"longitude": -2.248,
"address": "1 Hardman Square, Spinningfields, Manchester M3 3EB, United Kingdom",
"date": "2025-01-17T18:00",
"user_id": 4,
"type": "event"
},
"exampleResponse": {
"gem_id": 10,
"description": "accepts an object as a gem and adds it to gems",
"queries": [],
"accepts": {
"title": "Example Event Title",
"description": "Example event description",
"category": "culture",
"img_url": ["https://example-img-url.com/"],
"latitude": 53.4783,
"longitude": -2.248,
"address": "1 Hardman Square, Spinningfields, Manchester M3 3EB, United Kingdom",
"date": "2025-01-17T18:00",
"user_id": 4,
"rating": [],
"type": "event"
}
}
},
"PATCH /api/gems": {
"description": "accepts a key-value pair of a rating and adds it to the gems rating array, returning the new average rating",
"queries": [],
"accepts": {
"new_rating": 5
},
"exampleResponse": { "rating": 3 }
}
}