@@ -16,18 +16,32 @@ Snipe is an API backend for the Snipe Marketplace
16
16
"lastname": "Doe",
17
17
"phonenumber": "+ 2348077788899",
18
18
19
- "password": "theSafePa$$w0rd$$555//"
19
+ "dateofbirth": "2016-03-19",
20
+ "password": "theSafePa$$w0rd$$555//",
21
+ "address line1": "address line 1",
22
+ "address line2": "address line 2",
23
+ "regionorzip": "354662/LGA",
24
+ "state": "Toronto",
25
+ "country": "Nigeria"
20
26
}
21
27
22
28
+ Response 200 (application/json)
23
29
24
30
{
25
31
" status" : " success" ,
26
32
" data" : {
27
- " firstname" : " John" ,
28
- " lastname" : " Doe" ,
29
- " phonenumber" : " +2348077788899" ,
30
-
33
+ " user" : {
34
+ " firstname" : " John" ,
35
+ " lastname" : " Doe" ,
36
+ " phonenumber" : " +2348077788899" ,
37
+
38
+ },
39
+ " auth" : {
40
+ " accessToken" : " 2d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f" ,
41
+ " expiry" : " 3600" ,
42
+ " refreshToken" : " 3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f" ,
43
+ " x-tag" : " 3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f/=="
44
+ }
31
45
}
32
46
}
33
47
@@ -161,10 +175,18 @@ Do html redirect to the password reset successful page
161
175
{
162
176
" status" : " success" ,
163
177
" data" : {
164
- " accessToken" : " 2d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f" ,
165
- " expiry" : " 3600" ,
166
- " refreshToken" : " 3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f" ,
167
- " x-tag" : " 3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f/=="
178
+ " user" : {
179
+ " firstname" : " John" ,
180
+ " lastname" : " Doe" ,
181
+ " phonenumber" : " +2348077788899" ,
182
+
183
+ },
184
+ " auth" : {
185
+ " accessToken" : " 2d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f" ,
186
+ " expiry" : " 3600" ,
187
+ " refreshToken" : " 3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f" ,
188
+ " x-tag" : " 3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f/=="
189
+ }
168
190
}
169
191
}
170
192
@@ -298,7 +320,14 @@ Note: Do html redirect to the password reset successful page and kill the active
298
320
" lastname" : " Doe" ,
299
321
" addressBook" : [{
300
322
" phonenumber" : " +2348077788899" ,
301
-
323
+
324
+ " address" : {
325
+ " line1" : " address line 1" ,
326
+ " line2" : " address line 2" ,
327
+ " ziporregion" : " address line 1" ,
328
+ " state" : " address line 1" ,
329
+ " country" : " address line 1"
330
+ }
302
331
}]
303
332
},
304
333
{
@@ -307,7 +336,14 @@ Note: Do html redirect to the password reset successful page and kill the active
307
336
" lastname" : " Doe" ,
308
337
" addressBook" : [{
309
338
" phonenumber" : " +2348077788899" ,
310
-
339
+
340
+ " address" : {
341
+ " line1" : " address line 1" ,
342
+ " line2" : " address line 2" ,
343
+ " Zip/region" : " address line 1" ,
344
+ " state" : " address line 1" ,
345
+ " country" : " address line 1"
346
+ }
311
347
}]
312
348
}
313
349
]
@@ -498,6 +534,7 @@ Note: Do html redirect to the password reset successful page and kill the active
498
534
+ lastname: "John" (String) - Last name of the user
499
535
+ rangeFrom: "2017-03-01" (Date) - Date range start
500
536
+ rangeTo: "2017-03-15" (Date) - Date range end
537
+ + role: "worker" (Role) - Role of the user
501
538
502
539
+ Response 200 (application/json)
503
540
@@ -1127,6 +1164,71 @@ Note: Do html redirect to the password reset successful page and kill the active
1127
1164
" data" : {}
1128
1165
}
1129
1166
1167
+ ### Send Notification [POST /notifications]
1168
+
1169
+ + Headers
1170
+ Authorization: dd3343ae567c8f8a0b9e8f
1171
+
1172
+ + Request (application/json)
1173
+
1174
+ {
1175
+ "content": "This is a message",
1176
+ "destination": "
[email protected] ",
1177
+ "type": "email"
1178
+ }
1179
+
1180
+ + Response 200 (application/json)
1181
+
1182
+ {
1183
+ " status" : " success" ,
1184
+ " data" : {
1185
+ " id" : " 2d3343ae567c8f8a0b9e8f" ,
1186
+ " content" : " This is a message" ,
1187
+ " destination" : " [email protected] " ,
1188
+ " type" : " email" ,
1189
+ " is_opened" : true
1190
+ }
1191
+ }
1192
+
1193
+ + Response 400 (application/json)
1194
+
1195
+ {
1196
+ " status" : " error" ,
1197
+ " message" : " bad request" , // May come with a more detailed message sometimes
1198
+ " data" : {}
1199
+ }
1200
+
1201
+ + Response 503 (application/json)
1202
+
1203
+ {
1204
+ " status" : " error" ,
1205
+ " message" : " forbidden" , // May come with a more detailed message sometimes
1206
+ " data" : {}
1207
+ }
1208
+
1209
+ + Response 404 (application/json)
1210
+
1211
+ {
1212
+ " status" : " error" ,
1213
+ " message" : " not found"
1214
+ }
1215
+
1216
+ + Response 500 (application/json)
1217
+
1218
+ {
1219
+ " status" : " error" ,
1220
+ " message" : " server error" , // May come with a more detailed message sometimes
1221
+ " data" : {}
1222
+ }
1223
+
1224
+ + Response 401 (application/json)
1225
+
1226
+ {
1227
+ " status" : " error" ,
1228
+ " message" : " unauthorized" , // May come with a more detailed message sometimes
1229
+ " data" : {}
1230
+ }
1231
+
1130
1232
### View Notification [GET /notifications/:notification_id]
1131
1233
1132
1234
+ Headers
@@ -2222,7 +2324,7 @@ Note: Do html redirect to the password reset successful page and kill the active
2222
2324
}
2223
2325
2224
2326
### Recommend Worker for a Booking [GET /booking/:booking_id/recommendworker]
2225
- Check if the Worker is close to the state and LGA of the booking, then arrange the workers by rating. High rating first
2327
+ Check if the Worker matches some tags on the booking ( eg. the state and LGA of the booking) , then arrange the workers by rating. High rating first
2226
2328
2227
2329
+ Headers
2228
2330
Authorization: dd3343ae567c8f8a0b9e8f
@@ -3115,6 +3217,67 @@ Remember to requery the transaction to confirm the true state from the processor
3115
3217
" data" : {}
3116
3218
}
3117
3219
3220
+ + Response 401 (application/json)
3221
+
3222
+ {
3223
+ " status" : " error" ,
3224
+ " message" : " unauthorized" , // May come with a more detailed message sometimes
3225
+ " data" : {}
3226
+ }
3227
+
3228
+ ### Add New Role [POST /roles]
3229
+
3230
+ + Headers
3231
+ Authorization: dd3343ae567c8f8a0b9e8f
3232
+
3233
+ + Request (application/json)
3234
+
3235
+ {
3236
+ "rolename": "Admin"
3237
+ }
3238
+
3239
+ + Response 200 (application/json)
3240
+
3241
+ {
3242
+ " status" : " success" ,
3243
+ " data" : {
3244
+ " id" : " 2d3343ae567c8f8a0b9e8f" ,
3245
+ " rolename" : " Admin" ,
3246
+ " permisions" : []
3247
+ }
3248
+ }
3249
+
3250
+ + Response 400 (application/json)
3251
+
3252
+ {
3253
+ " status" : " error" ,
3254
+ " message" : " bad request" , // May come with a more detailed message sometimes
3255
+ " data" : {}
3256
+ }
3257
+
3258
+ + Response 503 (application/json)
3259
+
3260
+ {
3261
+ " status" : " error" ,
3262
+ " message" : " forbidden" , // May come with a more detailed message sometimes
3263
+ " data" : {}
3264
+ }
3265
+
3266
+ + Response 404 (application/json)
3267
+
3268
+ {
3269
+ " status" : " error" ,
3270
+ " message" : " not found"
3271
+ }
3272
+
3273
+ + Response 500 (application/json)
3274
+
3275
+ {
3276
+ " status" : " error" ,
3277
+ " message" : " server error" , // May come with a more detailed message sometimes
3278
+ " data" : {}
3279
+ }
3280
+
3118
3281
+ Response 401 (application/json)
3119
3282
3120
3283
{
0 commit comments