Skip to content

Commit 019043f

Browse files
committed
Documented Add Role and Send Notification endpoints
1 parent 84cebf4 commit 019043f

File tree

1 file changed

+175
-12
lines changed

1 file changed

+175
-12
lines changed

apiary.apib

Lines changed: 175 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,32 @@ Snipe is an API backend for the Snipe Marketplace
1616
"lastname": "Doe",
1717
"phonenumber": "+2348077788899",
1818
"email": "[email protected]",
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"
2026
}
2127

2228
+ Response 200 (application/json)
2329

2430
{
2531
"status": "success",
2632
"data": {
27-
"firstname": "John",
28-
"lastname": "Doe",
29-
"phonenumber": "+2348077788899",
30-
"email": "[email protected]"
33+
"user": {
34+
"firstname": "John",
35+
"lastname": "Doe",
36+
"phonenumber": "+2348077788899",
37+
"email": "[email protected]"
38+
},
39+
"auth": {
40+
"accessToken": "2d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f",
41+
"expiry": "3600",
42+
"refreshToken": "3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f",
43+
"x-tag": "3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f/=="
44+
}
3145
}
3246
}
3347

@@ -161,10 +175,18 @@ Do html redirect to the password reset successful page
161175
{
162176
"status": "success",
163177
"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+
"email": "[email protected]"
183+
},
184+
"auth": {
185+
"accessToken": "2d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f",
186+
"expiry": "3600",
187+
"refreshToken": "3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f",
188+
"x-tag": "3d3343ae567c8f8a0b9e8f2d3343ae567c8f8a0b9e8f/=="
189+
}
168190
}
169191
}
170192

@@ -298,7 +320,14 @@ Note: Do html redirect to the password reset successful page and kill the active
298320
"lastname": "Doe",
299321
"addressBook": [{
300322
"phonenumber": "+2348077788899",
301-
"email": "[email protected]"
323+
"email": "[email protected]",
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+
}
302331
}]
303332
},
304333
{
@@ -307,7 +336,14 @@ Note: Do html redirect to the password reset successful page and kill the active
307336
"lastname": "Doe",
308337
"addressBook": [{
309338
"phonenumber": "+2348077788899",
310-
"email": "[email protected]"
339+
"email": "[email protected]",
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+
}
311347
}]
312348
}
313349
]
@@ -498,6 +534,7 @@ Note: Do html redirect to the password reset successful page and kill the active
498534
+ lastname: "John" (String) - Last name of the user
499535
+ rangeFrom: "2017-03-01" (Date) - Date range start
500536
+ rangeTo: "2017-03-15" (Date) - Date range end
537+
+ role: "worker" (Role) - Role of the user
501538

502539
+ Response 200 (application/json)
503540

@@ -1127,6 +1164,71 @@ Note: Do html redirect to the password reset successful page and kill the active
11271164
"data": {}
11281165
}
11291166

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+
11301232
### View Notification [GET /notifications/:notification_id]
11311233

11321234
+ Headers
@@ -2222,7 +2324,7 @@ Note: Do html redirect to the password reset successful page and kill the active
22222324
}
22232325

22242326
### 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
22262328

22272329
+ Headers
22282330
Authorization: dd3343ae567c8f8a0b9e8f
@@ -3115,6 +3217,67 @@ Remember to requery the transaction to confirm the true state from the processor
31153217
"data": {}
31163218
}
31173219

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+
31183281
+ Response 401 (application/json)
31193282

31203283
{

0 commit comments

Comments
 (0)