|
3 | 3 | "_postman_id": "2b9fc136-67a7-4241-a816-a4cb71927c39",
|
4 | 4 | "name": "peerprep",
|
5 | 5 | "description": "# 🚀 Get started here\n\nThis template guides you through CRUD operations (GET, POST, PUT, DELETE), variables, and tests.\n\n## 🔖 **How to use this template**\n\n#### **Step 1: Send requests**\n\nRESTful APIs allow you to perform CRUD operations using the POST, GET, PUT, and DELETE HTTP methods.\n\nThis collection contains each of these [request](https://learning.postman.com/docs/sending-requests/requests/) types. Open each request and click \"Send\" to see what happens.\n\n#### **Step 2: View responses**\n\nObserve the response tab for status code (200 OK), response time, and size.\n\n#### **Step 3: Send new Body data**\n\nUpdate or add new data in \"Body\" in the POST request. Typically, Body data is also used in PUT request.\n\n```\n{\n \"name\": \"Add your name in the body\"\n}\n\n ```\n\n#### **Step 4: Update the variable**\n\nVariables enable you to store and reuse values in Postman. We have created a [variable](https://learning.postman.com/docs/sending-requests/variables/) called `base_url` with the sample request [https://postman-api-learner.glitch.me](https://postman-api-learner.glitch.me). Replace it with your API endpoint to customize this collection.\n\n#### **Step 5: Add tests in the \"Scripts\" tab**\n\nAdding tests to your requests can help you confirm that your API is working as expected. You can write test scripts in JavaScript and view the output in the \"Test Results\" tab.\n\n<img src=\"https://content.pstmn.io/fa30ea0a-373d-4545-a668-e7b283cca343/aW1hZ2UucG5n\" width=\"2162\" height=\"1530\">\n\n## 💪 Pro tips\n\n- Use folders to group related requests and organize the collection.\n \n- Add more [scripts](https://learning.postman.com/docs/writing-scripts/intro-to-scripts/) to verify if the API works as expected and execute workflows.\n \n\n## 💡Related templates\n\n[API testing basics](https://go.postman.co/redirect/workspace?type=personal&collectionTemplateId=e9a37a28-055b-49cd-8c7e-97494a21eb54&sourceTemplateId=ddb19591-3097-41cf-82af-c84273e56719) \n[API documentation](https://go.postman.co/redirect/workspace?type=personal&collectionTemplateId=e9c28f47-1253-44af-a2f3-20dce4da1f18&sourceTemplateId=ddb19591-3097-41cf-82af-c84273e56719) \n[Authorization methods](https://go.postman.co/redirect/workspace?type=personal&collectionTemplateId=31a9a6ed-4cdf-4ced-984c-d12c9aec1c27&sourceTemplateId=ddb19591-3097-41cf-82af-c84273e56719)",
|
6 |
| - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", |
7 |
| - "_exporter_id": "24939823", |
8 |
| - "_collection_link": "https://cs3219-g11.postman.co/workspace/CS3219-G11~db882cad-4ce9-4503-8852-cda2be0074c7/collection/24939823-2b9fc136-67a7-4241-a816-a4cb71927c39?action=share&source=collection_link&creator=24939823" |
| 6 | + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json", |
| 7 | + "_exporter_id": "27257144", |
| 8 | + "_collection_link": "https://cs3219-g11.postman.co/workspace/CS3219-G11~db882cad-4ce9-4503-8852-cda2be0074c7/collection/24939823-2b9fc136-67a7-4241-a816-a4cb71927c39?action=share&source=collection_link&creator=27257144" |
9 | 9 | },
|
10 | 10 | "item": [
|
11 | 11 | {
|
|
30 | 30 | "request": {
|
31 | 31 | "method": "GET",
|
32 | 32 | "header": [],
|
33 |
| - "url": { |
34 |
| - "raw": "{{question_base_url}}/questions/", |
35 |
| - "host": [ |
36 |
| - "{{question_base_url}}" |
37 |
| - ], |
38 |
| - "path": [ |
39 |
| - "questions", |
40 |
| - "" |
41 |
| - ] |
42 |
| - }, |
| 33 | + "url": "{{question_base_url}}/questions/", |
43 | 34 | "description": "This is a GET request and it is used to \"get\" data from an endpoint. There is no request body for a GET request, but you can use query parameters to help specify the resource you want data on (e.g., in this request, we have `id=1`).\n\nA successful GET response will have a `200 OK` status, and should include some kind of response body - for example, HTML web content or JSON data."
|
44 | 35 | },
|
45 | 36 | "response": []
|
|
76 | 67 | }
|
77 | 68 | }
|
78 | 69 | },
|
79 |
| - "url": { |
80 |
| - "raw": "{{question_base_url}}/userquestions/", |
81 |
| - "host": [ |
82 |
| - "{{question_base_url}}" |
83 |
| - ], |
84 |
| - "path": [ |
85 |
| - "userquestions", |
86 |
| - "" |
87 |
| - ] |
88 |
| - }, |
| 70 | + "url": "{{question_base_url}}/userquestions/", |
89 | 71 | "description": "This is a DELETE request, and it is used to delete data that was previously created via a POST request. You typically identify the entity being updated by including an identifier in the URL (eg. `id=1`).\n\nA successful DELETE request typically returns a `200 OK`, `202 Accepted`, or `204 No Content` response code."
|
90 | 72 | },
|
91 | 73 | "response": []
|
|
104 | 86 | }
|
105 | 87 | }
|
106 | 88 | },
|
107 |
| - "url": { |
108 |
| - "raw": "{{question_base_url}}/questions", |
109 |
| - "host": [ |
110 |
| - "{{question_base_url}}" |
111 |
| - ], |
112 |
| - "path": [ |
113 |
| - "questions" |
114 |
| - ] |
115 |
| - } |
| 89 | + "url": "{{question_base_url}}/questions" |
116 | 90 | },
|
117 | 91 | "response": []
|
118 | 92 | },
|
|
130 | 104 | }
|
131 | 105 | }
|
132 | 106 | },
|
133 |
| - "url": { |
134 |
| - "raw": "{{question_base_url}}/questions/66f97b1bcdb0da00fc58084f", |
135 |
| - "host": [ |
136 |
| - "{{question_base_url}}" |
137 |
| - ], |
138 |
| - "path": [ |
139 |
| - "questions", |
140 |
| - "66f97b1bcdb0da00fc58084f" |
141 |
| - ] |
142 |
| - } |
| 107 | + "url": "{{question_base_url}}/questions/66f97b1bcdb0da00fc58084f" |
143 | 108 | },
|
144 | 109 | "response": []
|
145 | 110 | },
|
|
148 | 113 | "request": {
|
149 | 114 | "method": "DELETE",
|
150 | 115 | "header": [],
|
151 |
| - "url": { |
152 |
| - "raw": "{{question_base_url}}/questions/66f77d44d9fc757910483d70", |
153 |
| - "host": [ |
154 |
| - "{{question_base_url}}" |
155 |
| - ], |
156 |
| - "path": [ |
157 |
| - "questions", |
158 |
| - "66f77d44d9fc757910483d70" |
159 |
| - ] |
160 |
| - } |
| 116 | + "url": "{{question_base_url}}/questions/66fd5763302ba91314db6976" |
161 | 117 | },
|
162 | 118 | "response": []
|
163 | 119 | }
|
|
173 | 129 | "header": [],
|
174 | 130 | "body": {
|
175 | 131 | "mode": "raw",
|
176 |
| - "raw": "{\n \"email\": \"[email protected]\",\n \"name\": \"exampleUser\",\n \"password\": \"securePassword123\",\n \"type\": \"User\"\n}", |
| 132 | + "raw": "{\n \"username\": \"kurt\",\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}", |
177 | 133 | "options": {
|
178 | 134 | "raw": {
|
179 | 135 | "language": "json"
|
180 | 136 | }
|
181 | 137 | }
|
182 | 138 | },
|
183 |
| - "url": { |
184 |
| - "raw": "{{account_base_url}}/register", |
185 |
| - "host": [ |
186 |
| - "{{account_base_url}}" |
187 |
| - ], |
188 |
| - "path": [ |
189 |
| - "register" |
190 |
| - ] |
191 |
| - } |
| 139 | + "url": "{{account_base_url}}/users" |
192 | 140 | },
|
193 | 141 | "response": []
|
194 | 142 | },
|
|
197 | 145 | "request": {
|
198 | 146 | "method": "POST",
|
199 | 147 | "header": [],
|
| 148 | + "body": { |
| 149 | + "mode": "raw", |
| 150 | + "raw": "{\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}", |
| 151 | + "options": { |
| 152 | + "raw": { |
| 153 | + "language": "json" |
| 154 | + } |
| 155 | + } |
| 156 | + }, |
| 157 | + "url": "{{account_base_url}}/auth/login" |
| 158 | + }, |
| 159 | + "response": [] |
| 160 | + }, |
| 161 | + { |
| 162 | + "name": "get user", |
| 163 | + "protocolProfileBehavior": { |
| 164 | + "disableBodyPruning": true |
| 165 | + }, |
| 166 | + "request": { |
| 167 | + "method": "GET", |
| 168 | + "header": [ |
| 169 | + { |
| 170 | + "key": "Authorization", |
| 171 | + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MDE3Zjg0YTI3OGNlMDY0Yjg5NjY1NSIsImlhdCI6MTcyODE1MTkxMiwiZXhwIjoxNzI4MjM4MzEyfQ._jYUmdO3DsML96M9x6u5-vT5ZItFG593bjNriwGYdmk", |
| 172 | + "type": "text" |
| 173 | + } |
| 174 | + ], |
200 | 175 | "body": {
|
201 | 176 | "mode": "raw",
|
202 | 177 | "raw": "{\n \"email\": \"[email protected]\",\n \"password\": \"securePassword123\"\n}",
|
|
206 | 181 | }
|
207 | 182 | }
|
208 | 183 | },
|
209 |
| - "url": { |
210 |
| - "raw": "{{account_base_url}}/login", |
211 |
| - "host": [ |
212 |
| - "{{account_base_url}}" |
213 |
| - ], |
214 |
| - "path": [ |
215 |
| - "login" |
216 |
| - ] |
217 |
| - } |
| 184 | + "url": "{{account_base_url}}/users/67024e05b263c7aa3f74f1b3" |
218 | 185 | },
|
219 | 186 | "response": []
|
220 | 187 | },
|
221 | 188 | {
|
222 |
| - "name": "token login", |
| 189 | + "name": "get all user", |
| 190 | + "protocolProfileBehavior": { |
| 191 | + "disableBodyPruning": true |
| 192 | + }, |
223 | 193 | "request": {
|
224 | 194 | "method": "GET",
|
225 |
| - "header": [] |
| 195 | + "header": [ |
| 196 | + { |
| 197 | + "key": "Authorization", |
| 198 | + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MDE3Zjg0YTI3OGNlMDY0Yjg5NjY1NSIsImlhdCI6MTcyODE1MTkxMiwiZXhwIjoxNzI4MjM4MzEyfQ._jYUmdO3DsML96M9x6u5-vT5ZItFG593bjNriwGYdmk", |
| 199 | + "type": "text" |
| 200 | + } |
| 201 | + ], |
| 202 | + "body": { |
| 203 | + "mode": "raw", |
| 204 | + "raw": "{\n \"email\": \"[email protected]\",\n \"password\": \"securePassword123\"\n}", |
| 205 | + "options": { |
| 206 | + "raw": { |
| 207 | + "language": "json" |
| 208 | + } |
| 209 | + } |
| 210 | + }, |
| 211 | + "url": "{{account_base_url}}/users" |
| 212 | + }, |
| 213 | + "response": [] |
| 214 | + }, |
| 215 | + { |
| 216 | + "name": "update user", |
| 217 | + "request": { |
| 218 | + "method": "PATCH", |
| 219 | + "header": [ |
| 220 | + { |
| 221 | + "key": "Authorization", |
| 222 | + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MDE3Zjg0YTI3OGNlMDY0Yjg5NjY1NSIsImlhdCI6MTcyODE1MTkxMiwiZXhwIjoxNzI4MjM4MzEyfQ._jYUmdO3DsML96M9x6u5-vT5ZItFG593bjNriwGYdmk", |
| 223 | + "type": "text" |
| 224 | + } |
| 225 | + ], |
| 226 | + "body": { |
| 227 | + "mode": "raw", |
| 228 | + "raw": "{\n \"username\": \"kurtyjlee\",\n \"email\": \"[email protected]\",\n \"password\": \"password\"\n}", |
| 229 | + "options": { |
| 230 | + "raw": { |
| 231 | + "language": "json" |
| 232 | + } |
| 233 | + } |
| 234 | + }, |
| 235 | + "url": "{{account_base_url}}/users/67024c2cdcc1796f39ddaa26" |
| 236 | + }, |
| 237 | + "response": [] |
| 238 | + }, |
| 239 | + { |
| 240 | + "name": "update user privileges", |
| 241 | + "request": { |
| 242 | + "method": "PATCH", |
| 243 | + "header": [ |
| 244 | + { |
| 245 | + "key": "Authorization", |
| 246 | + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MDE4NjE2YTAxYTk3NzE1MjdiOWJiMCIsImlhdCI6MTcyODE1MzEyMywiZXhwIjoxNzI4MjM5NTIzfQ._-3UN3f4czabZHWv_xZUACKFMGfF8X2zKw0-o2TxCJw", |
| 247 | + "type": "text" |
| 248 | + } |
| 249 | + ], |
| 250 | + "body": { |
| 251 | + "mode": "raw", |
| 252 | + "raw": "{\n \"isAdmin\": true\n}", |
| 253 | + "options": { |
| 254 | + "raw": { |
| 255 | + "language": "json" |
| 256 | + } |
| 257 | + } |
| 258 | + }, |
| 259 | + "url": "{{account_base_url}}/users/67024c2cdcc1796f39ddaa26/privilege" |
226 | 260 | },
|
227 | 261 | "response": []
|
228 | 262 | },
|
229 | 263 | {
|
230 |
| - "name": "Github OAuth", |
| 264 | + "name": "verify token", |
| 265 | + "protocolProfileBehavior": { |
| 266 | + "disableBodyPruning": true |
| 267 | + }, |
231 | 268 | "request": {
|
232 | 269 | "method": "GET",
|
233 |
| - "header": [] |
| 270 | + "header": [ |
| 271 | + { |
| 272 | + "key": "Authorization", |
| 273 | + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MDE3Zjg0YTI3OGNlMDY0Yjg5NjY1NSIsImlhdCI6MTcyODE1MTkxMiwiZXhwIjoxNzI4MjM4MzEyfQ._jYUmdO3DsML96M9x6u5-vT5ZItFG593bjNriwGYdmk", |
| 274 | + "type": "text" |
| 275 | + } |
| 276 | + ], |
| 277 | + "body": { |
| 278 | + "mode": "raw", |
| 279 | + "raw": "", |
| 280 | + "options": { |
| 281 | + "raw": { |
| 282 | + "language": "json" |
| 283 | + } |
| 284 | + } |
| 285 | + }, |
| 286 | + "url": "{{account_base_url}}/auth/verify-token" |
| 287 | + }, |
| 288 | + "response": [] |
| 289 | + }, |
| 290 | + { |
| 291 | + "name": "delete user", |
| 292 | + "request": { |
| 293 | + "method": "DELETE", |
| 294 | + "header": [ |
| 295 | + { |
| 296 | + "key": "Authorization", |
| 297 | + "value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MDE4NWRhYTAxYTk3NzE1MjdiOWJhOCIsImlhdCI6MTcyODE1MzA3MywiZXhwIjoxNzI4MjM5NDczfQ.OHIWsunOyuHjuJ2s7OmSERmPSHsPCaw8N9t46uKloqk", |
| 298 | + "type": "text" |
| 299 | + } |
| 300 | + ], |
| 301 | + "body": { |
| 302 | + "mode": "raw", |
| 303 | + "raw": "{\n \"isAdmin\": true\n}", |
| 304 | + "options": { |
| 305 | + "raw": { |
| 306 | + "language": "json" |
| 307 | + } |
| 308 | + } |
| 309 | + }, |
| 310 | + "url": "{{account_base_url}}/users/67024c2cdcc1796f39ddaa26" |
234 | 311 | },
|
235 | 312 | "response": []
|
236 | 313 | }
|
237 | 314 | ]
|
238 | 315 | }
|
239 | 316 | ],
|
| 317 | + "auth": { |
| 318 | + "type": "bearer", |
| 319 | + "bearer": { |
| 320 | + "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MDI0ZTA1YjI2M2M3YWEzZjc0ZjFiMyIsImlhdCI6MTcyODIwNDM0MSwiZXhwIjoxNzI4MjkwNzQxfQ.8ppV-YzpKIu0ldUsOIwbChYhdGNao5juYr2iea3D0JI" |
| 321 | + } |
| 322 | + }, |
240 | 323 | "event": [
|
241 | 324 | {
|
242 | 325 | "listen": "prerequest",
|
|
269 | 352 | },
|
270 | 353 | {
|
271 | 354 | "key": "account_base_url",
|
272 |
| - "value": "localhost:4040", |
| 355 | + "value": "localhost:3001", |
273 | 356 | "type": "string"
|
274 | 357 | }
|
275 | 358 | ]
|
|
0 commit comments