-
Notifications
You must be signed in to change notification settings - Fork 0
/
RedditDemo.postman_collection.json
227 lines (227 loc) · 8.37 KB
/
RedditDemo.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
{
"info": {
"_postman_id": "3ef487e5-eb0e-4e66-b894-699b8d12fceb",
"name": "RedditDemo",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "http://localhost:3000/auth/register",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"ad@bla.com\",\n \"password\": \"b3lapass\"\n}"
},
"url": {
"raw": "http://192.168.43.8:3000/auth/register",
"protocol": "http",
"host": [
"192",
"168",
"43",
"8"
],
"port": "3000",
"path": [
"auth",
"register"
]
},
"description": "POST API - Register a user using this API\n\nPOST DATA\n\n{\n \"email\" : <valid>\n \"password\" : <valid>\n}\n\nRESPONSE\n\n{\n \"error\": 0,\n \"message\": \"Success!!\"\n}"
},
"response": []
},
{
"name": "http://localhost:3000/auth/login",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"ad@bla.com\",\n \"password\": \"b3lapass\"\n}"
},
"url": {
"raw": "http://192.168.43.8:3000/auth/login",
"protocol": "http",
"host": [
"192",
"168",
"43",
"8"
],
"port": "3000",
"path": [
"auth",
"login"
]
},
"description": "POST API - Login Using this API, and use the response token as header Authorization in non-authentication APIS.\n\nPOST DATA \n\n{\n \"email\": <valid>,\n \"password\": text\n}\n\nRESPONSE - \n\n{\n \"error\": 0,\n \"message\": \"Success\",\n \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmOGMzNjM0Y2YyMjE3MDAxMzRmNzZkMyIsInVzZXJuYW1lIjoiYWRAYmxhLmNvbSIsImRhdGUiOiIyMDIwLTEwLTE4VDEyOjM0OjE0LjkwNFoiLCJpYXQiOjE2MDMwMjQ0NTQsImV4cCI6MTYwMzAyODA1NH0.Xyqgkq9dUWe3XYZhLC7c_apZ9tBIQnnUg7VV59Q-oPE\"\n}"
},
"response": []
},
{
"name": "http://localhost:3000/thread/create",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "Authorization",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmOGNhNDg4MGQzZmIwMDAxOWJhYWM0NCIsInVzZXJuYW1lIjoiYWRAYmxhLmNvbSIsImRhdGUiOiIyMDIwLTEwLTE4VDIwOjI0OjU0Ljk5OFoiLCJpYXQiOjE2MDMwNTI2OTQsImV4cCI6MTYwMzA1NjI5NH0.d5TJCV5b1MfDFytBrM_CUqS5OLDesfMNbPHcJRBUB6w",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"title\": \"This is a new thread title 1\",\n \"content\": \"This is a thread content 1\"\n}\n",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/thread/create",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"thread",
"create"
]
},
"description": "POST API - Create Threads \n\nHeader - Authorization: <token returned at login>\n\nPOST DATA - \n\n{\n \"title\": \"This is a new thread title\",\n \"content\": \"This is a thread content\"\n}\n\nRESPONSE -\n\n{\n \"error\": 0,\n \"message\": \"Success!!\",\n \"data\": {\n \"title\": \"This is a new thread title\",\n \"content\": \"This is a thread content\",\n \"threadId\": \"5f8bf85bf1ec050014e82e3e\"\n }\n}"
},
"response": []
},
{
"name": "http://localhost:3000/post/create",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "Authorization",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmOGNhNDg4MGQzZmIwMDAxOWJhYWM0NCIsInVzZXJuYW1lIjoiYWRAYmxhLmNvbSIsImRhdGUiOiIyMDIwLTEwLTE4VDIwOjI0OjU0Ljk5OFoiLCJpYXQiOjE2MDMwNTI2OTQsImV4cCI6MTYwMzA1NjI5NH0.d5TJCV5b1MfDFytBrM_CUqS5OLDesfMNbPHcJRBUB6w",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"content\": \"First Post on First Thread\",\n \"parent_post_id\": \"5f8ca4c80d3fb00019baac51\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/post/create",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"post",
"create"
]
},
"description": "POST API - Create Posts\n\nHEADER - Authorization : <token returned at login>\n\nPOST DATA - \n\nEither parent_post_id or thread_id to be sent.\n\n{\n \"content\": \"First Post on Second Thread\",\n \"parent_post_id\": \"5f8bf866f1ec050014e82e42\", \n \"thread_id\": \"5f8bf866f1ec050014e82e42\"\n}\n\nRESPONSE\n{\n \"error\": 0,\n \"message\": \"Success!!\",\n \"data\": {\n \"content\": \"First Post on Second Thread\",\n \"postId\": \"5f8bf86ef1ec050014e82e43\"\n }\n}"
},
"response": []
},
{
"name": "http://localhost:3000/reactiontype/get",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "Authorization",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmOGNhNDg4MGQzZmIwMDAxOWJhYWM0NCIsInVzZXJuYW1lIjoiYWRAYmxhLmNvbSIsImRhdGUiOiIyMDIwLTEwLTE4VDIwOjI0OjU0Ljk5OFoiLCJpYXQiOjE2MDMwNTI2OTQsImV4cCI6MTYwMzA1NjI5NH0.d5TJCV5b1MfDFytBrM_CUqS5OLDesfMNbPHcJRBUB6w",
"type": "text"
}
],
"url": {
"raw": "http://localhost:3000/reactiontype/get",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"reactiontype",
"get"
]
},
"description": "GET API - Get available reaction types\n\nHEADER - Authorization : <token returned at auth/login>\n\nResponse -\n\n{\n \"error\": 0,\n \"message\": \"Success!!\",\n \"data\": [\n {\n \"_id\": \"5f8c35460cabdba16e25d698\",\n \"codes\": \"1F44E\",\n \"char\": \"👎\",\n \"name\": \"thumbs down\",\n \"category\": \"People & Body (hand-fingers-closed)\",\n \"group\": \"People & Body\",\n \"subgroup\": \"hand-fingers-closed\"\n },\n {\n \"_id\": \"5f8c35460cabdba16e25d699\",\n \"codes\": \"1F44D\",\n \"char\": \"👍\",\n \"name\": \"thumbs up\",\n \"category\": \"People & Body (hand-fingers-closed)\",\n \"group\": \"People & Body\",\n \"subgroup\": \"hand-fingers-closed\"\n },\n {\n \"_id\": \"5f8c35460cabdba16e25d69a\",\n \"codes\": \"1F4AF\",\n \"char\": \"💯\",\n \"name\": \"hundred points\",\n \"category\": \"Smileys & Emotion (emotion)\",\n \"group\": \"Smileys & Emotion\",\n \"subgroup\": \"emotion\"\n }\n ]\n}"
},
"response": []
},
{
"name": "http://localhost:3000/react",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "Authorization",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmOGQ0Y2E2MTA2ZDYzMDAxOWIzOGExOSIsInVzZXJuYW1lIjoiYWRAYmxhLmNvbSIsImRhdGUiOiIyMDIwLTEwLTE5VDA4OjIyOjA0LjQ3NFoiLCJpYXQiOjE2MDMwOTU3MjQsImV4cCI6MTYwMzA5OTMyNH0.5-TaPz2DefjlHW2hCbDgYUWi4ykFMqUr1D5hnKW1OSI",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"reaction_type_id\": \"5f8ca44f622d792fdede1b80\",\n \"thread_id\": \"5f8ca4b00d3fb00019baac47\"\n}"
},
"url": {
"raw": "http://localhost:3000/react",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"react"
]
},
"description": "POST API - Submit Reaction to a specific post or thread\n\nPOST DATA - \n\n{\n \"reaction_type_id\": \"5f8ca44f622d792fdede1b80\",\n \"thread_id\": \"5f8ca4b00d3fb00019baac47\" || \"post_id\": \"5f8ca4b00d3fb00019baac47\"\n}\n\nRESPONSE -\n\n{\n \"error\": 0,\n \"message\": \"Success!!\",\n \"data\": {\n \"reactionId\": \"5f8d4cba106d630019b38a1a\"\n }\n}"
},
"response": []
}
],
"protocolProfileBehavior": {}
}