-
Notifications
You must be signed in to change notification settings - Fork 3
/
EasyWay API Documentation.postman.json
1299 lines (1299 loc) · 52.3 KB
/
EasyWay API Documentation.postman.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"info": {
"_postman_id": "014cb12e-fe98-431f-b510-8a529a3f89b0",
"name": "EasyWay API",
"description": "The EasyWay's API is a JSON-based API that allows developers to access and interact with the web application's data and functionalities. All requests are made to endpoints beginning with \"[http://localhost:3000/api](http://localhost:3000/api)\" and \"[http://localhost:5000](http://localhost:5000/)\", and can be made using HTTP methods.\n\nBy using the EasyWay's API, developers can build custom integrations or third-party applications that can communicate with the web application's backend. This API documentation provides detailed information about the available endpoints, their input and output parameters, and the necessary authentication requirements to access them.\n\nWhether you are building a mobile application, integrating with a third-party service, or simply exploring the possibilities of the EasyWay's API, this documentation will guide you through the process and help you get started quickly and efficiently.",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "23815648",
"_collection_link": "https://easywayapis.postman.co/workspace/Team-Workspace~8691dc6b-dbf2-45ad-8fd6-25229db4786f/collection/23815648-014cb12e-fe98-431f-b510-8a529a3f89b0?action=share&creator=23815648&source=collection_link"
},
"item": [
{
"name": "User",
"item": [
{
"name": "Add user",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"alex\",\n \"email\": \"alex@pace.edu\",\n \"gender\": \"F\",\n \"username\": \"alex\",\n \"password\": \"alex1\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/user",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"user"
]
},
"description": "The \"Add user\" API POST endpoint allows clients to create a new user in the system. The endpoint URL is \"[http://localhost:3000/api/user](http://localhost:3000/api/user)\". The request must contain a JSON object in the request body with the following attributes:\n\n- \"name\": The name of the user (string)\n- \"email\": The email of the user (string)\n- \"gender\": The gender of the user, either \"M\" (male) or \"F\" (female) (string)\n- \"username\": The username of the user (string)\n- \"password\": The password of the user (string)\n \n\nIf the request is successful, the server will return a 201 CREATED status code along with a JSON object containing the newly created user's attributes, including an \"id\" attribute generated by the server."
},
"response": [
{
"name": "Add user",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"alex\",\n \"email\": \"alex@pace.edu\",\n \"gender\": \"F\",\n \"username\": \"alex\",\n \"password\": \"alex1\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/user",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"user"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Accept",
"value": "application/x-www-form-urlencoded"
},
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type"
},
{
"key": "Access-Control-Allow-Methods",
"value": "POST"
},
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "Tue, 22 Feb 2022 00:32:35 GMT"
},
{
"key": "Content-Length",
"value": "95"
}
],
"cookie": [],
"body": "{\n \"id\": 4,\n \"name\": \"alex\",\n \"username\": \"alex\",\n \"password\": \"alex1\",\n \"email\": \"alex@pace.edu\",\n \"gender\": \"F\"\n}"
}
]
},
{
"name": "Get user details",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "http://localhost:3000/api/user/dummy",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"user",
"dummy"
]
},
"description": "The \"Get user details\" API GET endpoint allows clients to retrieve the details of a user from the system. The endpoint URL includes the user's unique identifier, for example \"[http://localhost:3000/api/user/1](http://localhost:3000/api/user/1)\" to retrieve the details of user with id 1.\n\nIn the example provided, the endpoint URL is \"[http://localhost:3000/api/user/dummy](http://localhost:3000/api/user/dummy)\" which suggests that there might be a user in the system with the username \"dummy\".\n\nIf the request is successful, the server will return a 200 OK status code along with a JSON object containing the requested user's attributes."
},
"response": [
{
"name": "Get user details",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/api/user/dummy",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"user",
"dummy"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "Tue, 22 Feb 2022 00:33:36 GMT"
},
{
"key": "Content-Length",
"value": "104"
}
],
"cookie": [],
"body": "{\n \"id\": 1,\n \"name\": \"Dummy Duck\",\n \"username\": \"dummy\",\n \"password\": \"dumdum\",\n \"email\": \"dummy@ufl.edu\",\n \"gender\": \"M\"\n}"
}
]
},
{
"name": "Forgot Password",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"dummy@pace.edu\"\n}\n"
},
"url": {
"raw": "http://localhost:3000/api/forgotPassword",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"forgotPassword"
]
},
"description": "This is a RESTful API for resetting a forgotten password in a web application. The API endpoint is located at [http://localhost:3000/api/forgotPassword](http://localhost:3000/api/forgotPassword) and accepts a POST request. The request body is expected to contain a JSON object with the email address of the user who forgot their password. The API response is a JSON object containing a message indicating that a temporary password has been sent to the email address provided.\n\nTo use this API, clients can make a POST request to the endpoint with the email address of the user who forgot their password included in the request body. The API will then generate a temporary password and send it to the email address provided. The client will receive a JSON response indicating that the temporary password has been sent to the email address.\n\nThis API can be used by web developers who want to provide their users with a way to reset their passwords if they forget them. It simplifies the process of resetting a password for the user and can help reduce the number of support requests related to password resets.\n\nIf the request is successful, the server will return a 200 OK status code along with a JSON object containing the requested user's attributes."
},
"response": [
{
"name": "Forgot Password",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"dummy@pace.edu\"\n}\n"
},
"url": {
"raw": "http://localhost:3000/api/forgotPassword",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"forgotPassword"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type"
},
{
"key": "Access-Control-Allow-Methods",
"value": "POST"
},
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Vary",
"value": "Origin"
},
{
"key": "Date",
"value": "Fri, 28 Apr 2023 17:14:33 GMT"
},
{
"key": "Content-Length",
"value": "62"
}
],
"cookie": [],
"body": "{\n \"message\": \"A temporary password has been sent to your email\"\n}"
}
]
},
{
"name": "Forgot Username",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"dummy@pace.edu\" \n}\n"
},
"url": {
"raw": "http://localhost:3000/api/forgotUsername",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"forgotUsername"
]
},
"description": "This is a RESTful API for resetting a forgotten username in a web application. The API endpoint is located at [http://localhost:3000/api/forgotUsername](http://localhost:3000/api/forgotUsername) and accepts a POST request. The request body is expected to contain a JSON object with the email address of the user who forgot their username. The API response is a JSON object containing a message indicating that a temporary username has been sent to the email address provided.\n\nTo use this API, clients can make a POST request to the endpoint with the email address of the user who forgot their username included in the request body. The API will then generate a temporary username and send it to the email address provided. The client will receive a JSON response indicating that the temporary username has been sent to the email address.\n\nThis API can be used by web developers who want to provide their users with a way to reset their usernames if they forget them. It simplifies the process of resetting a username for the user and can help reduce the number of support requests related to username resets.\n\nIf the request is successful, the server will return a 200 OK status code along with a JSON object containing the requested user's attributes."
},
"response": [
{
"name": "Forgot Username",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"email\": \"dummy@pace.edu\" \n}\n"
},
"url": {
"raw": "http://localhost:3000/api/forgotUsername",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"forgotUsername"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type"
},
{
"key": "Access-Control-Allow-Methods",
"value": "POST"
},
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Vary",
"value": "Origin"
},
{
"key": "Date",
"value": "Fri, 28 Apr 2023 17:14:38 GMT"
},
{
"key": "Content-Length",
"value": "62"
}
],
"cookie": [],
"body": "{\n \"message\": \"A temporary username has been sent to your email\"\n}"
}
]
}
],
"description": "The User contains the API documentation for a web application. It includes descriptions of the available endpoints, their inputs and outputs, and any relevant information about authentication, errors, and usage guidelines.\n\nWithin this, there are several endpoint descriptions for user-related actions.\n\nThe \"**POST** Add User\" endpoint allows a user to be created with the specified details.\n\nThe \"**GET** Get User Details\" endpoint retrieves the details of a specific user, based on their unique identifier.\n\nThe \"**POST** Forgot Password\" endpoint initiates the process for a user to reset their forgotten password.\n\nThe \"**POST** Forgot Username\" endpoint initiates the process for a user to retrieve their forgotten username.\n\nEach endpoint should have its own separate documentation file, outlining the specific parameters, responses, and any additional information required for usage."
},
{
"name": "Service",
"item": [
{
"name": "Get all services",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/api/services",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"services"
]
},
"description": "The \"Get all services\" API GET endpoint allows clients to retrieve a list of all services from the system. The endpoint URL is \"[http://localhost:3000/api/services](http://localhost:3000/api/services)\".\n\nIf the request is successful, the server will return a 200 OK status code along with a JSON object containing an array of service objects. Each service object in the array will contain the attributes of the service, such as service id, name, description, and cost."
},
"response": [
{
"name": "Get all services",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/api/services",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"services"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "Tue, 22 Feb 2022 00:34:25 GMT"
},
{
"key": "Content-Length",
"value": "639"
}
],
"cookie": [],
"body": "[\n {\n \"id\": 1,\n \"name\": \"AC Maintanence\",\n \"description\": \"Any type of AC maintanence such as filter cleaning, part replacement, etc.\",\n \"username\": \"Electronics\"\n },\n {\n \"id\": 2,\n \"name\": \"Plumbing\",\n \"description\": \"Sanitary and household plumbing. No sewage service.\",\n \"username\": \"Household\"\n },\n {\n \"id\": 3,\n \"name\": \"Saloon\",\n \"description\": \"Haricut, massage, nailwork, makeup, etc.\",\n \"username\": \"Personal Care\"\n },\n {\n \"id\": 4,\n \"name\": \"Furniture Repair\",\n \"description\": \"Furniture frame repair, drilling, fitting new furniture, etc.\",\n \"username\": \"Household\"\n },\n {\n \"id\": 5,\n \"name\": \"Exterminator\",\n \"description\": \"Pest control, wildlife evac, alligator emergency, etc.\",\n \"username\": \"Animal/Pet\"\n }\n]"
}
]
},
{
"name": "Search Services",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"body\" : \"Plumber\"\n} ",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/services/search?name=plum",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"services",
"search"
],
"query": [
{
"key": "name",
"value": "plum"
}
]
},
"description": "This API allows users to search for services based on a query parameter 'name'. The endpoint URL is [http://localhost:3000/api/services/search?name=plum](http://localhost:3000/api/services/search?name=plum), and the HTTP method is GET. The query parameter 'name' is required and should be specified in the URL as `name=`. A request body is optional, and can be sent as JSON in the raw text format.\n\nAn example request is provided in cURL format, with the query parameter 'name' set to 'plum' and a request body specifying a search query for 'Plumber'. The response is returned as a JSON array of services matching the search query, each service represented as an object with the following properties: 'id', 'name', 'description', 'category', 'image_name', and 'price'."
},
"response": [
{
"name": "Search Services",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"body\" : \"Plumber\"\n} ",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/services/search?name=plum",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"services",
"search"
],
"query": [
{
"key": "name",
"value": "plum"
}
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"
},
{
"key": "Access-Control-Allow-Methods",
"value": "GET, POST, PUT, DELETE, OPTIONS"
},
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Vary",
"value": "Origin"
},
{
"key": "Date",
"value": "Sat, 29 Apr 2023 19:08:07 GMT"
},
{
"key": "Content-Length",
"value": "160"
}
],
"cookie": [],
"body": "[\n {\n \"id\": 2,\n \"name\": \"Plumbing\",\n \"description\": \"Sanitary and household plumbing. No sewage service.\",\n \"category\": \"Household\",\n \"image_name\": \"plumbing.jpg\",\n \"price\": 100\n }\n]"
}
]
}
],
"description": "The Service contains the API documentation for a web application. It includes descriptions of the available endpoints, their inputs and outputs, and any relevant information about authentication, errors, and usage guidelines.\n\nWithin this, there are several endpoint descriptions for service-related actions.\n\nThe \"**GET** Get all services\" endpoint retrieves a list of all available services within the system.\n\nThe \"**GET** Search Services\" endpoint allows users to search for services based on certain criteria, such as keywords or specific parameters.\n\nEach endpoint should have its own separate documentation file, outlining the specific parameters, responses, and any additional information required for usage. The documentation should also include any relevant examples or code snippets to assist developers in using the API."
},
{
"name": "Booking",
"item": [
{
"name": "Get bookings from a given user",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/api/bookings/3",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"bookings",
"3"
]
},
"description": "The \"Get bookings from a given user\" API GET endpoint allows clients to retrieve a list of all bookings associated with a particular user. The endpoint URL includes the user's unique identifier, for example \"[http://localhost:3000/api/bookings/3](http://localhost:3000/api/bookings/3) retrieve the bookings of user with id 3.\n\nIf the request is successful, the server will return a 200 OK status code along with a JSON object containing an array of booking objects. Each booking object in the array will contain the attributes of the booking, such as booking id, user id, service id, date, start time, and end time."
},
"response": [
{
"name": "Get bookings from a given user",
"originalRequest": {
"method": "GET",
"header": [],
"url": {
"raw": "http://localhost:3000/api/bookings/2",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"bookings",
"2"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "Tue, 22 Feb 2022 00:36:10 GMT"
},
{
"key": "Content-Length",
"value": "135"
}
],
"cookie": [],
"body": "{\n \"id\": 2,\n \"user_id\": 0,\n \"service_id\": 3,\n \"date\": \"2022-02-15T16:30:00Z\",\n \"start_time\": \"2022-02-15T16:30:00Z\",\n \"end_time\": \"2022-02-15T17:30:00Z\"\n}"
}
]
},
{
"name": "Book a service",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"id\": 5,\n \"user_id\": 3,\n \"service_id\": 4,\n \"date\": \"2022-02-15\",\n \"start_time\": \"12:30\",\n \"end_time\": \"13:30\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/bookService",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"bookService"
]
},
"description": "The \"Book a service\" API POST endpoint allows clients to book a service by creating a new booking. Clients can send a cURL POST request to the endpoint \"[http://localhost:3000/api/bookService](http://localhost:3000/api/bookService)\" to create a new booking.\n\nThe request body must include a JSON object that contains the following attributes:\n\n- id: the unique identifier for the booking\n- user_id: the unique identifier for the user who is making the booking\n- service_id: the unique identifier for the service being booked\n- date: the date of the booking, in YYYY-MM-DD format\n- start_time: the start time of the booking, in HH:MM format\n- end_time: the end time of the booking, in HH:MM format\n \n\nIf the request is successful, the server will return a 201 CREATED status code along with a JSON object containing the attributes of the new booking.\n\nIf there is an error in creating the new booking, the server will return an appropriate error response."
},
"response": [
{
"name": "Book a service",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"id\": 2,\n \"user_id\": 1,\n \"service_id\": 3,\n \"date\": \"2022-02-15\",\n \"start_date\": \"11:30\",\n \"end_date\": \"13:30\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/bookService",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"bookService"
]
}
},
"status": "Internal Server Error",
"code": 500,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Accept",
"value": "application/x-www-form-urlencoded"
},
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type"
},
{
"key": "Access-Control-Allow-Methods",
"value": "POST"
},
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "Thu, 24 Feb 2022 05:02:08 GMT"
},
{
"key": "Content-Length",
"value": "65"
}
],
"cookie": [],
"body": "{\n \"error\": \"Error 1062: Duplicate entry '2' for key 'bookings.id'\"\n}"
},
{
"name": "Book a service",
"originalRequest": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"id\": 4,\n \"user_id\": 1,\n \"service_id\": 4,\n \"date\": \"2022-02-15\",\n \"start_time\": \"11:30\",\n \"end_time\": \"13:30\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/bookService",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"bookService"
]
}
},
"status": "Created",
"code": 201,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Accept",
"value": "application/x-www-form-urlencoded"
},
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type"
},
{
"key": "Access-Control-Allow-Methods",
"value": "POST"
},
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Date",
"value": "Thu, 24 Feb 2022 06:01:06 GMT"
},
{
"key": "Content-Length",
"value": "232"
}
],
"cookie": [],
"body": "{\n \"id\": 4,\n \"user_id\": 1,\n \"service_id\": 4,\n \"date\": \"2022-02-15\",\n \"start_time\": \"11:30\",\n \"end_time\": \"13:30\",\n \"User\": {\n \"id\": 0,\n \"name\": \"\",\n \"username\": \"\",\n \"password\": \"\",\n \"email\": \"\",\n \"gender\": \"\"\n },\n \"Service\": {\n \"id\": 0,\n \"name\": \"\",\n \"description\": \"\",\n \"username\": \"\"\n }\n}"
}
]
},
{
"name": "Update Booking",
"request": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"id\": 1,\n \"user_id\": 1,\n \"service_id\": 1,\n \"date\": \"2023-06-15\",\n \"start_time\": \"12:00\",\n \"end_time\": \"13:00\",\n \"note\": \"Updated booking note\"\n}\n"
},
"url": {
"raw": "http://localhost:3000/api/updateBooking",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"updateBooking"
]
},
"description": "This API is a PUT endpoint that updates an existing booking based on its ID. The endpoint is located at [http://localhost:3000/updateBooking](http://localhost:3000/updateBooking) and expects a query parameter \"id\" that represents the ID of the booking to be updated.\n\nThe request body contains a JSON object that represents the updated booking details. The example shows an updated booking with an ID of 1, userId of 1, serviceId of 1, and a new date, start time, and end time for the booking. Additionally, there is a boolean flag \"isCancelled\" to indicate if the booking has been cancelled.\n\nThe API will update the booking details based on the ID provided in the query parameter and the new booking details provided in the request body. The response of the API will indicate the success or failure of the update operation.\n\nThis API is useful in various applications that require updating existing bookings, such as booking systems for hotels, restaurants, or other service-based businesses."
},
"response": [
{
"name": "Update Booking",
"originalRequest": {
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"Id\": 1,\n \"UserId\": 1,\n \"ServiceId\": 1,\n \"Date\": \"2023-06-15\",\n \"StartTime\": \"12:00\",\n \"EndTime\": \"13:00\",\n \"Note\": \"Updated booking note\"\n}\n"
},
"url": {
"raw": "http://localhost:3000/api/updateBooking",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"updateBooking"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type"
},
{
"key": "Access-Control-Allow-Methods",
"value": "PUT"
},
{
"key": "Access-Control-Allow-Origin",
"value": "http://localhost:4200"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Vary",
"value": "Origin"
},
{
"key": "Date",
"value": "Sat, 06 May 2023 05:05:04 GMT"
},
{
"key": "Content-Length",
"value": "136"
}
],
"cookie": [],
"body": "{\n \"id\": 1,\n \"user_id\": 1,\n \"service_id\": 0,\n \"date\": \"2023-06-15\",\n \"start_time\": \"\",\n \"end_time\": \"\",\n \"is_cancelled\": false,\n \"note\": \"Updated booking note\"\n}"
}
]
}
],
"description": "The Booking contains the API documentation for a web application. It includes descriptions of the available endpoints, their inputs and outputs, and any relevant information about authentication, errors, and usage guidelines.\n\nWithin this, there are several endpoint descriptions for booking-related actions.\n\nThe \"**GET** Get Bookings from a given user\" endpoint retrieves a list of all bookings made by a specific user, based on their unique identifier.\n\nThe \"**POST** Book a Service\" endpoint allows users to create a new booking for a particular service, providing the necessary details and parameters.\n\nThe \"**PUT** Update Booking\" endpoint allows users to update an existing booking, based on its unique identifier. This may include changes to the date, time, or service details.\n\nEach endpoint should have its own separate documentation file, outlining the specific parameters, responses, and any additional information required for usage. The documentation should also include any relevant examples or code snippets to assist developers in using the API."
},
{
"name": "Blog",
"item": [
{
"name": "Get All Blogs",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/getAllBlogs",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"getAllBlogs"
]
},
"description": "This is a RESTful API that retrieves all the blogs in a web application. The API endpoint is located at [http://localhost:3000/api/getAllBlogs](http://localhost:3000/api/getAllBlogs) and accepts a GET request. The request body is empty, and the API response is a JSON object containing an array of all the blogs in the web application.\n\nTo use this API, clients can make a GET request to the endpoint with no request body. The API will then retrieve all the blogs in the web application and return them in a JSON array. Each blog in the array contains an id, a title, content, created_at and updated_at timestamp, and an optional image_name attribute.\n\nThis API can be used by web developers who want to display all the blogs in their web application to users. It simplifies the process of retrieving all the blogs in the web application and makes it easier for clients to integrate the blogs into their website or application."
},
"response": [
{
"name": "Get All Blogs",
"originalRequest": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:3000/api/getAllBlogs",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"getAllBlogs"
]
}
},
"status": "OK",
"code": 200,
"_postman_previewlanguage": "json",
"header": [
{
"key": "Access-Control-Allow-Headers",
"value": "Content-Type"
},
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Vary",
"value": "Origin"
},
{
"key": "Date",
"value": "Sat, 29 Apr 2023 19:06:12 GMT"
},
{
"key": "Content-Length",
"value": "1762"
}
],
"cookie": [],
"body": "[\n {\n \"id\": 1,\n \"title\": \"Why On-Demand Services are the Future of Convenience\",\n \"content\": \"On-demand services have become a popular trend in recent years due to their convenience and accessibility. With the rise of smartphones and apps, people are able to order almost anything they need at the touch of a button. From food delivery to ride-sharing to home cleaning services, on-demand services offer a wide range of options for consumers. They eliminate the need for physical stores and the inconvenience of waiting in long lines or driving to multiple locations. With the COVID-19 pandemic accelerating the shift towards online and contactless services, on-demand services have become even more crucial for people looking to get what they need quickly and safely.\",\n \"created_at\": \"2023-04-25 07:30\",\n \"updated_at\": \"2023-04-25 07:32\",\n \"image_name\": \"house_cleaning.jpg\"\n },\n {\n \"id\": 2,\n \"title\": \"The Pros and Cons of On-Demand Home Cleaning Services\",\n \"content\": \"On-demand home cleaning services have become a popular choice for busy people looking to outsource their household chores. These services offer the convenience of scheduling and paying for cleaning online, without the need for face-to-face communication with the cleaners. However, there are some drawbacks to these services. One of the main concerns is the quality of the cleaning. With on-demand services, the cleaners may not be as thorough as you would like, and there may be a lack of consistency between different cleaners. Additionally, on-demand cleaning services can be more expensive than hiring a regular cleaner or cleaning yourself. They often charge a premium for the convenience and flexibility they offer.\",\n \"created_at\": \"2023-04-25 09:15\",\n \"updated_at\": \"2023-04-25 09:30\",\n \"image_name\": \"refridgerator.jpg\"\n }\n]"
}
]
}
],
"description": "The Blog contains the API documentation for a web application. It includes descriptions of the available endpoints, their inputs and outputs, and any relevant information about authentication, errors, and usage guidelines.\n\nWithin this, there is a single endpoint description for retrieving all blogs.\n\nThe \"**GET** Get All Blogs\" endpoint retrieves a list of all blog posts available within the system. This endpoint may include parameters to filter the results based on certain criteria, such as author or category.\n\nThe endpoint should have its own separate documentation file, outlining the specific parameters, responses, and any additional information required for usage. The documentation should also include any relevant examples or code snippets to assist developers in using the API."
},
{
"name": "Comment",
"item": [
{
"name": "Get All Comments of a Blog",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "http://localhost:3000/api/getAllComments/1",
"protocol": "http",
"host": [
"localhost"
],
"port": "3000",
"path": [
"api",
"getAllComments",
"1"
]
},
"description": "This is a RESTful API that retrieves comments associated with a particular blog post. The API endpoint is located at [http://localhost:3000/api/getAllComments/1](http://localhost:3000/api/getAllComments/1), it likely accepts a GET request with a blog_id parameter that identifies the blog post to retrieve comments for.\n\nThe API response is a JSON array containing one or more comment objects. Each comment object contains an id that uniquely identifies the comment, a blog_id that indicates the blog post the comment is associated with, a content field that contains the text of the comment, and created_at and updated_at fields that indicate when the comment was created and last updated, respectively.\n\nThis API can be used by web developers who want to display comments associated with a particular blog post to users. By providing an API endpoint to retrieve comments, developers can simplify the process of retrieving and displaying comments and can integrate the comments into their website or application."
},
"response": [
{
"name": "Get All Comments of a Blog",
"originalRequest": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "http://localhost:3000/api/getAllComments/1",