-
Notifications
You must be signed in to change notification settings - Fork 0
/
.http
98 lines (78 loc) · 2.05 KB
/
.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@host = http://localhost:3000
### Register new user
POST {{host}}/register
Content-Type: application/json
{
"username": "[email protected]",
"password": "foobar"
}
### Login
# @name login
POST {{host}}/login
Content-Type: application/json
{
"username": "[email protected]",
"password": "foobar"
}
### Get all professors
GET {{host}}/professors
### Get specific professor
GET {{host}}/professors/3
### Add a new professor
POST {{host}}/professors
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "Lester",
"bio": "Foobar baz wobble!",
"profileImage": "www.google.image.com",
"email": "[email protected]",
"phone": "13533197233",
"departmentId": 1
}
### Delete a specific professor
DELETE {{host}}/professors/5
Authorization: Bearer {{token}}
Content-Type: application/json
### Change the information of an existing professor
PUT {{host}}/professors/6
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "Lester",
"bio": "Foobar baz wobble!",
"profileImage": "www.google.image.com",
"email": "[email protected]",
"phone": "13533197233",
"departmentId": 2
}
### Get all departments
GET {{host}}/departments
### Get department with a specific id
GET {{host}}/departments/2
###Store login token
# @token = {{login.response.body.token}}
### Post a new department if logged in
POST {{host}}/departments
Authorization: Bearer {{token}}
Content-Type: application/json
{
"name": "Department Name",
"description": "Department Description",
"image": "https://picsum.photos/200",
"departmentEmail": "[email protected]",
"departmentPhone": "123-456-7890",
"professorIds": [1]
}
### Update a department with name, description, or image when logged in
PUT {{host}}/departments/20/change
# Authorization: Bearer {{token}},
# Content-Type: application/json
{
"name": "Updated Department Name",
"description": "Updated Department Description",
"image": "https://picsum.photos/200"
}
### When logged in, delete a specific department
DELETE {{host}}/departments/10
Authorization: Bearer {{token}}