-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSESC - Student Portal.postman_collection.json
285 lines (285 loc) · 6.9 KB
/
SESC - Student Portal.postman_collection.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
{
"info": {
"_postman_id": "2d6b2867-67dd-4d85-8497-85df57d9e0ea",
"name": "SESC - Student Portal",
"description": "## ℹ️ Resources\n\n[http://localhost:8082/studentportal-docs/v1/swagger-ui/index.html](http://localhost:8082/studentportal-docs/v1/swagger-ui/index.html)",
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json",
"_exporter_id": "32686033"
},
"item": [
{
"name": "Auth",
"item": [
{
"name": "Register",
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"username\": \"tavi\",\n \"password\": \"albert1234\",\n \"email\" : \"tarkaa.albert@gmail.com\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{base_url}}/auth/register"
},
"response": []
},
{
"name": "Login",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var jsonData = pm.response.json();",
"var token = jsonData.data.authToken;",
"",
"pm.environment.set(\"auth_token\", token);",
"",
"var jsonData = pm.response.json();",
"var studentID = jsonData.data.id;",
"",
"pm.environment.set(\"id\", studentID);"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"username\": \"tavi\",\n \"password\": \"albert1234\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{base_url}}/auth/#"
},
"response": []
}
],
"description": "**Register**: A POST request to /auth/register that allows a new user to register by providing a username, password, and email.\n\n**Login**: A POST request to /auth/# that authenticates a user by providing a username and password. The response includes an authentication token and the user's ID, which are stored as environment variables (auth_token and id, respectively) for use in subsequent requests.\n\n**Logout**: A POST request to /auth/logout that logs out the user.",
"auth": {
"type": "bearer",
"bearer": {}
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"packages": {},
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"packages": {},
"exec": [
""
]
}
}
]
},
{
"name": "Student",
"item": [
{
"name": "View Student Profile",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "{{auth_token}}"
}
},
"method": "GET",
"header": [],
"url": "{{base_url}}/student/{{id}}"
},
"response": []
},
{
"name": "Update Student Profile",
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "{{auth_token}}"
}
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"codex\",\n \"lastName\": \"alera\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{base_url}}/student/update/{{id}}"
},
"response": []
},
{
"name": "Get Graduation Status",
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "{{auth_token}}"
}
},
"method": "GET",
"header": [],
"url": "{{base_url}}/student/getGraduationStatus/{{id}}"
},
"response": []
}
],
"description": "**View Student Profile:** A GET request to /student/{{id}} that retrieves the profile of the student identified by the id environment variable (set during the login process). \n \n\n**Update Student Profile:** A POST request to /student/update/{{id}} that updates the student's first and last name."
},
{
"name": "Enrollments",
"item": [
{
"name": "Get data",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript",
"packages": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "{{auth_token}}"
}
},
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/course/list?CourseName=labore",
"host": [
"{{base_url}}"
],
"path": [
"course",
"list"
],
"query": [
{
"key": "CourseName",
"value": "labore"
}
]
},
"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."
},
"response": []
},
{
"name": "Enroll in Course",
"request": {
"auth": {
"type": "bearer",
"bearer": {
"token": "{{auth_token}}"
}
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"courseCode\": \"SESC502\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": "{{base_url}}/course/enroll/{{id}}"
},
"response": []
}
],
"description": "**Get data:** A GET request to /course/list that retrieves a list of courses. The CourseName query parameter can be used to filter the list by course name.\n\n**Enroll in Course:** A POST request to /course/enroll/{{id}} that enrolls the student (identified by the id environment variable) in a course specified by the courseCode in the request body."
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "base_url",
"value": "http://localhost:8082/api"
},
{
"key": "Authorization: Bearer {{auth_token}}",
"value": "",
"type": "string"
},
{
"key": "studentID: {{studentID}}",
"value": "",
"type": "string"
}
]
}