-
Notifications
You must be signed in to change notification settings - Fork 16
/
test.http
177 lines (111 loc) · 6.13 KB
/
test.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
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
########### PRODUCTS BY SEARCH ########
GET http://localhost:5000/products
########### PRODUCTS BY CATEGORY ########
GET http://localhost:5000/products/electronics
############ PRODUCTS BY CATEGOEY AND ID ##########
GET http://localhost:5000/products/electronics/5fda124ef08b7d0f6c2475ba/
#################### create Product review #######################
POST http://localhost:5000/products/electronics/5fda124ef08b7d0f6c2475ba/reviews
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYwNDYzNTcwZjcyNDRlMWI3ODZiMGJjMCIsImlhdCI6MTYxNTIxMzk5NiwiZXhwIjoxNjE1MjE3NTk2fQ.6mGqIXBK815NXgHPj9rm_e3TiCFawbSSI5gk5o7O0rE
{
"rating": "10",
"comment": "Omaagoo turu love"
}
################# Product delete #################################
DELETE http://localhost:5000/products/electronics/5fda124ef08b7d0f6c2475c0/
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4
################ POST new product #################################
POST http://localhost:5000/products/
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4
# {
# "price": 49.99,
# "countInStock": 7,
# "numReviews": 2,
# "rating": 2.5,
# "_id": "5fda124ef08b7d0f6c2475be",
# "name": "Logitech G-Series Gaming Mouse",
# "image": "/assets/images/electronics/mouse.jpg",
# "description": "Get a better handle on your games with this Logitech LIGHTSYNC gaming mouse. The six programmable buttons allow customization for a smooth playing experience",
# "brand": "Logitech",
# "category": "electronics",
# "user": "5fda124ef08b7d0f6c2475b6",
# "reviews": [
# {
# "rating": 4,
# "_id": "601b81fe71198234800344bc",
# "name": "Saaho Dutta",
# "comment": "nunu kata",
# "user": "5fe5a236726d4d0c84f2f659",
# "createdAt": "2021-02-04T05:11:26.478Z",
# "updatedAt": "2021-02-04T05:11:26.478Z"
# }
# ],
# "__v": 2,
# "createdAt": "2020-12-16T13:57:34.230Z",
# "updatedAt": "2021-02-04T05:23:23.304Z"
# }
################ Auth Check ########################
GET http://localhost:5000/user/auth
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNjA3MTYzOSwiZXhwIjoxNjE2MDcxNjY5fQ.Z688fjFmBNU7LuJUxNSaU-me1g4OTHCk5Y-xTe3OdDM
####################### LOGIN ####################
POST http://localhost:5000/user/login
Content-Type: application/json
{
"email": "[email protected]",
"password": "user12345"
}
##################### REGSITER #####################
POST http://localhost:5000/user/register
Content-Type: application/json
{
"name": "test",
"email": "[email protected]",
"password": "user1234"
}
######################## PROFILE #####################
GET http://localhost:5000/user/profile
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4
######################## GET all users (for admin) ##########
GET http://localhost:5000/user
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4
######################## GET user by id (for admin) ##########
GET http://localhost:5000/user/601b6f8f490cf240a814590a
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4
######################## DELETE user by id (for admin) ##########
DELETE http://localhost:5000/user/602f3baee941690004f131a1
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4
###################### UPDATE user by id (for admin) #############
PUT http://localhost:5000/user/6048f18caa96ca40441615cb
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4
{
"isAdmin": true,
"name": "test2"
}
################## FORGET PASSWORD ########################
######## email verification ##########
POST http://localhost:5000/user/email-verify
Content-Type: application/json
{
"email": "[email protected]"
}
######## reset password #########
POST http://localhost:5000/user/reset-password/5fd82c40-0bae-4442-8fef-630de800169a
Content-Type: application/json
{
"password": "user12345"
}
######################### ORDERS BY ID ##################
GET http://localhost:5000/orders/5fed5fdb7073bf0b6ce37038
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6eyJpZCI6IjYwNDYzNTcwZjcyNDRlMWI3ODZiMGJjMCIsImlhdCI6MTYxNTIyNTYzMCwiZXhwIjoxNjQ2NzgzMjMwfSwiaWF0IjoxNjE1MjI4NDkzLCJleHAiOjE2MTUyMjg1MjN9.rIXB9uySIufe4yNI7Xp9M9eG_tr8K0IoWYnYFoXvCfc
####################### PAYPAL CONFIG #####################
GET http://localhost:5000/config/paypal
###################### LOGGED IN USER ORDERS (paid) #############
GET http://localhost:5000/orders/myorders
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTVhMjM2NzI2ZDRkMGM4NGYyZjY1OSIsImlhdCI6MTYxNTIxMTMwMSwiZXhwIjoxNjE1MjE0OTAxfQ.gTTicFfLdipDV2SbEGSBmVfTK2tEgv5yr3nu1w4vnss
###################### ALL ORDERS (for admin user) #############
GET http://localhost:5000/orders
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmZTI1MDZmNWE5MDI0MDU3OGYwY2MxMCIsImlhdCI6MTYxNTM5Mjc4MiwiZXhwIjoxNjE2MjU2NzgyfQ.ggtdTg_JHyFmDYd-IqM6Py31IACLG0C13FRij64Tz_4