forked from WebSolutions2k21/CodersCamp2021.Project.Node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrest.http
More file actions
219 lines (187 loc) · 5.46 KB
/
rest.http
File metadata and controls
219 lines (187 loc) · 5.46 KB
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
###
# ____________________________ Authentication ____________________________
###
# login
POST http://localhost:5000/login
Content-Type: application/json
{
"email": "margiebed+8@gmail.com",
"password": "12345678"
}
###
# ____________________________ USERS ____________________________
# create users only requied fields
POST http://localhost:5000/users/register HTTP/1.1
Content-Type: application/json
{
"username": "username_test",
"firstname":"firstname_test",
"lastname":"lastname_test",
"email": "test@mail.com",
"password": "12345678",
"confirmpassword": "12345678"
}
###
###
# get all users
GET http://localhost:5000/users HTTP/1.1
###
###
# change Password
PUT http://localhost:5000/users/changepassword HTTP/1.1
x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjIzN2ViYWRiOWY2ZDBkNWMzN2I3MTEiLCJ1c2VybmFtZSI6IkFuaWEiLCJpYXQiOjE2NDY1ODYyMDB9.GNeUognnUdkqUez-TCG6iSQtBLXvwHIAHm1OP3ZeIQg
Content-Type: application/json
{
"oldPassword": "12345678",
"newPassword": "12345678",
"confirmNewPassword": "12345678"
}
###
# send email newPassword
POST http://localhost:5000/users/resetpassword HTTP/1.1
x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjI1MTU4OTIxODY2MTE4NTBkZDc2ZDMiLCJ1c2VybmFtZSI6IkFuaWEiLCJpYXQiOjE2NDY1OTc1Mzl9.yw4gpU7qJHsjQDS0DFqahfn_sb4u9xKEZYH3OGuxmfU
Content-Type: application/json
{
"email": "zioqzpqrrzzahktysg@bvhrk.com"
}
###
# new password
PUT http://localhost:5000/users/newpassword HTTP/1.1
x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjI1MTU4OTIxODY2MTE4NTBkZDc2ZDMiLCJ1c2VybmFtZSI6IkFuaWEiLCJpYXQiOjE2NDY1OTc1Mzl9.yw4gpU7qJHsjQDS0DFqahfn_sb4u9xKEZYH3OGuxmfU
Content-Type: application/json
{
"newPassword": "123456789",
"confirmNewPassword": "123456789"
}
###
# get only one user
GET http://localhost:5000/users/622515892186611850dd76d3 HTTP/1.1
###
###
# get check is mentor
GET http://localhost:5000/users/role/62239d63a5182b274496ee34 HTTP/1.1
###
# get all mentors
GET http://localhost:5000/users/mentors HTTP/1.1
###
# get check is mentor
PATCH http://localhost:5000/users/62239d63a5182b274496ee34 HTTP/1.1
Content-Type: application/json
{
"username": "t55tt",
"firstname": "Edit user",
"lastname": "Gosia last",
"email": "test@test.xyz",
"isMentor": true
}
###
# ____________________________ TEAM ____________________________
POST http://localhost:5000/team/create HTTP/1.1
Content-Type: application/json
{
"teamName": "Team Node 2",
"usersIds": [],
"mentorId": "62210331e4339c1e71363587",
"programmingLanguage": [
{
"nameLang": "node",
"level": "beginner"
}
],
"status": true,
"places": 10,
"description": "Only learn node"
}
###
GET http://localhost:5000/team HTTP/1.1
###
GET http://localhost:5000/team/6235fa33621d817289f6e462 HTTP/1.1
###
PUT http://localhost:5000/team/62278e3a7cafabc04f5cbeab HTTP/1.1
Content-Type: application/json
{
"teamName": "Ftr",
"usersIds": ["621d35383e5c3315845ca334"],
"programmingLanguage": [
{
"nameLang": "javaeeee",
"level": "jhjh"
}
],
"status": true
}
###
DELETE http://localhost:5000/team/62278e3a7cafabc04f5cbeab HTTP/1.1
###
#Join Team
PUT http://localhost:5000/team/join/62651720564414412e13b1bd HTTP/1.1
x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjNjMTYzMTBhMjQxZjBlYjExNmFlNDAiLCJ1c2VybmFtZSI6InFxIiwiaWF0IjoxNjUwNzk4MDgxfQ.LkQIsGlEcZdvgTUu9TQepsD4f1SvwK0uC-67m_b2-Vw
Content-Type: application/json
###
# user Teams
GET http://localhost:5000/team/user-team HTTP/1.1
x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjI1MTU4OTIxODY2MTE4NTBkZDc2ZDMiLCJ1c2VybmFtZSI6IkFuaWEiLCJpYXQiOjE2NTA4MTQxOTJ9.RH85bFJ2pdBj0sflcdjv7VulTXb84TbbfHDKaxoic10
Content-Type: application/json
###
# ____________________________ PROJECT____________________________
# create Project
POST http://localhost:5000/project/create
Content-Type: application/json
{
"name": "Projekt ja22282",
"userId": "622b9441f2950d6fe0a2b40e",
"mentorId": "",
"content": "aplikacja",
"status": "true"
}
###
# edit Project
PUT http://localhost:5000/project/6235f9b909fe6e1c88fde621
Content-Type: application/json
{
"name": "Zmieniona nazwa",
"userId": "4edd40c86762e0fb12000003",
"mentorId": "fcee56c86762e0fb12000112",
"content": "Dodany mentor"
}
###
# get all Project
GET http://localhost:5000/project/
###
# delete Project
DELETE http://localhost:5000/project/622b96d05564155028570b45
###
# get User Projects
GET http://localhost:5000/project/user-projects
x-auth-token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MjIzN2ViYWRiOWY2ZDBkNWMzN2I3MTEiLCJ1c2VybmFtZSI6IkFuaWEiLCJpYXQiOjE2NDY1ODYyMDB9.GNeUognnUdkqUez-TCG6iSQtBLXvwHIAHm1OP3ZeIQg
Content-Type: application/json
###
# ____________________________TEAM PROJECT ____________________________
###
# ____________________________ OPINIONS ____________________________
# create opinion
POST http://localhost:5000/opinion/create
Content-Type: application/json
{
"userId": "4edd40c86762e0fb12000005",
"mentorId": "fcee56c86762e0fb12000112",
"content": "Opinia pięciogwiazdkowa",
"stars": "4"
}
###
# edit opinion
PUT http://localhost:5000/opinion/edit
Content-Type: application/json
{
"content": "Opinia czterogwiadkowa"
}
###
#
# DELETE http://localhost:5000/opinion/delete
DELETE http://localhost:5000/opinion/
###
# get one opinion
GET http://localhost:5000/opinion/6234f97af8b4d700ef698542
###
# get all opinions
GET http://localhost:5000/opinion