Newer
Older
{
"openapi": "3.0.1",
"info": {
"title": "Sparesti API",
"description": "The Sparesti API",
"version": "3.0"
},
"servers": [
{
"url": "http://localhost:8080",
"description": "Generated server url"
}
],
"security": [
{
"Bearer Authentication": []
}
],
"tags": [
{
"name": "Friend",
"description": "API for managing friend relationships"
}
],
"/api/users/subscription/{subscriptionLevel}": {
"put": {
"tags": [
"User"
],
"summary": "Update User Subscription Level",
"description": "Updates the subscription level of the current user",
"operationId": "updateSubscriptionLevel",
"parameters": [
{
"name": "subscriptionLevel",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Subscription level updated successfully",
"content": {
"*/*": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/api/friends/{friendId}": {
"put": {
"tags": [
"Friend"
],
"summary": "Accept a friend request",
"description": "Accepts a friend request from another user.",
"operationId": "acceptFriendRequest",
"parameters": [
{
"name": "friendId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"404": {
"description": "Friend request not found",
"content": {
"*/*": {
"schema": {
"type": "object"
}
}
}
},
"200": {
"description": "Friend request successfully accepted",
"content": {
"*/*": {
"schema": {
"type": "object"
}
}
}
}
}
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
},
"delete": {
"tags": [
"Friend"
],
"summary": "Delete a friend or cancel a friend request",
"description": "Deletes an existing friend from your friend list or cancels a received friend request.",
"operationId": "deleteFriendOrFriendRequest",
"parameters": [
{
"name": "friendId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"404": {
"description": "Friend or friend request not found",
"content": {
"*/*": {
"schema": {
"type": "object"
}
}
}
},
"200": {
"description": "Friend successfully deleted or friend request cancelled",
"content": {
"*/*": {
"schema": {
"type": "object"
}
}
}
}
}
"/bank/v1/transaction/norwegian-domestic-payment-to-self": {
"post": {
"tags": [
"transaction-controller"
],
"summary": "Transfer to account",
"description": "Transfer money from a users account to another account of the same user",
"operationId": "transferToSelf",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TransactionDTO"
}
}
},
"required": true
},
"responses": {
"404": {
"description": "Bank profile id does not exist",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/TransactionDTO"
}
}
}
},
"200": {
"description": "No accounts associated with a bank user",
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
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/TransactionDTO"
}
}
}
}
}
}
},
"/bank/v1/profile/create-profile": {
"post": {
"tags": [
"bank-profile-controller"
],
"summary": "Create bank profile",
"description": "Create a bank profile by providing a social security number",
"operationId": "createBankProfile",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BankProfileDTO"
}
}
},
"required": true
},
"responses": {
"400": {
"description": "Could not create profile",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/BankProfileResponseDTO"
}
}
}
},
"200": {
"description": "Successfully created a bank profile",
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
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/BankProfileResponseDTO"
}
}
}
}
}
}
},
"/bank/v1/account/create-account": {
"post": {
"tags": [
"account-controller"
],
"summary": "Create account",
"description": "Create account with random balance",
"operationId": "createAccount",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AccountRequestDTO"
}
}
},
"required": true
},
"responses": {
"404": {
"description": "Provided bank profile id could not be found",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/AccountResponseDTO"
}
}
}
},
"200": {
"description": "Successfully created account",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/AccountResponseDTO"
}
}
}
}
}
}
},
"/api/users/send-feedback": {
"post": {
"tags": [
"User"
],
"summary": "Send feedback",
"description": "Send feedback from an email.",
"operationId": "sendFeedback",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeedbackRequestDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Success"
}
}
}
},
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
"/api/users/reset-password": {
"post": {
"tags": [
"User"
],
"summary": "Initiate a password reset",
"description": "Send a password reset mail to the user with the specified email",
"operationId": "resetPassword",
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"required": true
},
"responses": {
"202": {
"description": "Successfully initiated a password reset"
}
},
"security": []
}
},
"/api/users/confirm-password": {
"post": {
"tags": [
"User"
],
"summary": "Confirm a password reset",
"description": "Confirms a password reset using a token and a new password",
"operationId": "confirmPasswordReset",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PasswordResetDTO"
}
}
},
"required": true
},
"responses": {
"403": {
"description": "Invalid token"
},
"204": {
"description": "Password was reset successfully"
"post": {
"tags": [
"Image"
],
"summary": "Upload an image",
"description": "Upload an image to the server",
"operationId": "uploadImage",
"requestBody": {
"content": {
"multipart/form-data": {
"schema": {
"required": [
"file"
],
"type": "object",
"properties": {
"file": {
"type": "string",
"format": "binary"
}
}
}
}
}
},
"responses": {
"description": "Successfully uploaded the image",
"content": {
"*/*": {
"schema": {
"type": "integer",
"format": "int64"
}
}
}
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
}
}
}
},
"/api/goal/createGoal": {
"post": {
"tags": [
"goal"
],
"operationId": "createGoal",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CreateGoalDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/GoalDTO"
}
}
}
}
}
}
},
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
"/api/friends/{userId}": {
"post": {
"tags": [
"Friend"
],
"summary": "Send a friend request",
"description": "Sends a new friend request to another user.",
"operationId": "addFriendRequest",
"parameters": [
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"201": {
"description": "Friend request successfully created"
}
}
}
},
"post": {
"tags": [
"User"
],
"summary": "Updates a budget",
"description": "Updates a budget based on the budget request",
"operationId": "updateBudget",
"parameters": [
{
"name": "budgetId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
}
}
},
"required": true
},
"responses": {
"500": {
"description": "Budget is not found",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"200": {
"description": "Successfully updated budget",
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
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/api/budget/update/expense/{budgetId}": {
"post": {
"tags": [
"User"
],
"summary": "Created/Updates an expense",
"description": "Creates/Updates a budget based on the budget request",
"operationId": "updateExpense",
"parameters": [
{
"name": "budgetId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExpenseRequestDTO"
}
}
},
"required": true
},
"responses": {
"500": {
"description": "Error updating expense",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
},
"200": {
"description": "Successfully updated budget",
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
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/api/budget/create": {
"post": {
"tags": [
"User"
],
"summary": "Create a new budget",
"description": "Create a new budget with based on the budget request",
"operationId": "createBudget",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BudgetRequestDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully created new budget",
"content": {
"application/json": {
"schema": {
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
}
}
}
}
}
}
},
"/api/auth/valid-email/{email}": {
"post": {
"tags": [
"Authentication"
],
"summary": "Validate email",
"description": "Check that the given email is valid",
"operationId": "validateEmail",
"parameters": [
{
"name": "email",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Email is valid",
"type": "object"
"409": {
"description": "Email already exists",
"$ref": "#/components/schemas/ExceptionResponse"
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
}
}
}
}
},
"security": []
}
},
"/api/auth/signup": {
"post": {
"tags": [
"Authentication"
],
"summary": "User Signup",
"description": "Sign up a new user",
"operationId": "signup",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SignUpRequest"
}
}
},
"required": true
},
"responses": {
"201": {
"description": "Successfully signed up",
"$ref": "#/components/schemas/AuthenticationResponse"
"409": {
"description": "Email already exists",
"$ref": "#/components/schemas/ExceptionResponse"
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
}
}
}
}
},
"security": []
}
},
"/api/auth/login": {
"post": {
"tags": [
"Authentication"
],
"summary": "User Login",
"description": "Log in with an existing user",
"operationId": "login",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LoginRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully logged in",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AuthenticationResponse"
}
}
}
},
"404": {
"description": "User not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExceptionResponse"
}
}
}
},
"401": {
"description": "Invalid credentials",
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
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ExceptionResponse"
}
}
}
}
},
"security": []
}
},
"/api/users": {
"patch": {
"tags": [
"User"
],
"summary": "Update a profile",
"description": "Update the profile of the authenticated user",
"operationId": "update",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserUpdateDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully updated profile",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserDTO"
}
}
}
}
}
}
},
"/api/users/update-account": {
"patch": {
"tags": [
"User"
],
"summary": "Update a user's bank account",
"description": "Changes either a user's checking account or savings account",
"operationId": "selectBankAccount",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BankAccountDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/Account"
}
}
}
}
}
}
},
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
"/api/users/password": {
"patch": {
"tags": [
"User"
],
"summary": "Update a password",
"description": "Update the password of the authenticated user",
"operationId": "updatePassword",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PasswordUpdateDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully updated password",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/UserDTO"
}
}
}
}
}
}
},
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
"/bank/v1/account/accounts/ssn/{ssn}": {
"get": {
"tags": [
"account-controller"
],
"summary": "Get user accounts",
"description": "Get accounts associated with a user by providing their social security number",
"operationId": "getAccountsBySsn",
"parameters": [
{
"name": "ssn",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "No accounts associated with a bank user",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Account"
}
}
}
}
},
"404": {
"description": "Social security number does not exist",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Account"
}
}
}
}
}
}
}
},
"/bank/v1/account/accounts/profile/{bankProfileId}": {
"get": {
"tags": [
"account-controller"
],
"summary": "Get user accounts",
"description": "Get accounts associated with a user by providing their bank profile id",
"operationId": "getAccounts",
"parameters": [
{
"name": "bankProfileId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"404": {
"description": "Bank profile id does not exist",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Account"
}
}
}
}
},
"200": {
"description": "No accounts associated with a bank user",
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
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Account"
}
}
}
}
}
}
}
},
"/api/users/{userId}/profile": {
"get": {
"tags": [
"User"
],
"summary": "Get a profile",
"description": "Get the profile of a user",
"operationId": "getProfile",
"parameters": [
{
"name": "userId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"200": {
"description": "Successfully got profile",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProfileDTO"
}
}
}
}
}
}
},
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
"/api/users/search/{searchTerm}/{filter}": {
"get": {
"tags": [
"User"
],
"summary": "Search for users by name and filter",
"description": "Returns a list of users whose names contain the specified search term and match the filter.",
"operationId": "getUsersByNameAndFilter",
"parameters": [
{
"name": "searchTerm",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "filter",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Successfully retrieved list of users",
"content": {
"*/*": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserDTO"
}
}
}
}
}
}
}
},
"/api/users/search/random/{amount}/{filter}": {
"get": {
"tags": [
"User"
],
"summary": "Get X amount of random users",
"description": "Get X amount of random users that fit the filter",
"operationId": "getRandomUsers",
"parameters": [