Swagger UI

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

1.

0 OAS3
Truewiser Backend
API documentation

Authorize

health

GET /api/health Health check

GET Health status of the server

Parameters Cancel

No parameters

Execute Clear

Responses

Curl

curl -X 'GET' \
'https://dna-assets-truewiser.alpha.mckinsey.digital/api/health' \

-H 'accept: application/json'

Request URL

https://dna-assets-truewiser.alpha.mckinsey.digital/api/health

Server response

Code Details
Code Details

200
Response body

"status": "HEALTHY"

}
Download

Response headers

access-control-allow-origin: *
cache-control: no-store
content-length: 20
content-type: application/json; charset=utf-8
date: Fri,22 Apr 2022 05:39:41 GMT
etag: W/"14-94WU8cQMcXwDc3aOB5nUrRFySiI"
expires: 0
pragma: no-cache
server: CloudFront
strict-transport-security: max-age=63072000; includeSubdomains; preload
surrogate-control: no-store
via: 1.1 6a3d98aad6a6ea4a9a35b5590bdb3da6.cloudfront.net (CloudFront)
x-amz-cf-id: OON4Xg7pL452HBh7yiRj69Wqnwl-zFLkuDFTvWrw3Goq26jfERInbg==
x-amz-cf-pop: MRS52-P1
x-cache: Miss from cloudfront
x-powered-by: Express

Responses

Code Description Links

200 No links
Health status of the server

Media type

application/json
Controls Accept header.

Example Value Schema

"status": "HEALTHY"

auth

POST /api/auth/login Login to application

Login to the application using username & password, Also create a new user if username does not exist

Parameters Cancel Reset


No parameters

required
Request body application/json

"username": "tw_admin",

"password": "tw_admin"

Execute Clear

Responses

Curl

curl -X 'POST' \

'https://dna-assets-truewiser.alpha.mckinsey.digital/api/auth/login' \

-H 'accept: */*' \
-H 'Content-Type: application/json' \

-d '{

"username": "tw_admin",

"password": "tw_admin"

}'

Request URL

https://dna-assets-truewiser.alpha.mckinsey.digital/api/auth/login

Server response

Code Details
Code Details

201
Response body

"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjEsInVzZXJuYW1lI‐
joidHdfYWRtaW4iLCJyb2xlIjoiQWRtaW4iLCJpYXQiOjE2NTA2MDYwMDYsImV4cCI6MTY1MDc3ODgwNn0.Mq
KGrfheEOZUbg0AAGpNUh4froE2H2DTdKNANIm8wwM",

"userId": 1,

"username": "tw_admin"

Download
}

Response headers

access-control-allow-origin: *
cache-control: no-store
content-length: 243
content-type: application/json; charset=utf-8
date: Fri,22 Apr 2022 05:40:06 GMT
etag: W/"f3-XnqMvAPTmIhgENeHhgodSTHjMG4"
expires: 0
pragma: no-cache
server: CloudFront
strict-transport-security: max-age=63072000; includeSubdomains; preload
surrogate-control: no-store
via: 1.1 6a3d98aad6a6ea4a9a35b5590bdb3da6.cloudfront.net (CloudFront)
x-amz-cf-id: syfLvhTBUd_MHZ6iULdGh7YOMVxd1lKgoN739wb3czl0-kYpGvHcug==
x-amz-cf-pop: MRS52-P1
x-cache: Miss from cloudfront
x-powered-by: Express

Responses

Code Description Links

200 No links
Valid token to access the other endpoints

201 No links

users

GET /api/users/{id} Get the user profile details by id

Get the user profile details by id

Parameters Cancel

Name Description
Name Description

required
id *
number 1
(path)

Execute Clear

Responses

Curl

curl -X 'GET' \
'https://dna-assets-truewiser.alpha.mckinsey.digital/api/users/1' \

-H 'accept: application/json' \

-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjUsInVzZXJuYW1lIjoic

Request URL

https://dna-assets-truewiser.alpha.mckinsey.digital/api/users/1

Server response

Code Details

200
Response body

"id": 1,

"username": "tw_admin",

"password": "$2a$10$xIi8pzl/Z11Wf4gO27uTMOvLULGnX/p/WEMkvGVbCyu/TXSDg9T0a",

"role": "Admin",

"createdAt": "2022-04-21T11:31:02.071Z",

"updatedAt": "2022-04-21T11:31:02.071Z",

"userProfile": null,

"userOccupation": null,

"userFinance": null

Download
}

Response headers

access-control-allow-origin: *
cache-control: no-store
content-length: 257
content-type: application/json; charset=utf-8
date: Fri,22 Apr 2022 05:41:14 GMT
etag: W/"101-y0ac0gqCxixLZhO6tIVbH8ccNQ8"
expires: 0
pragma: no-cache
server: CloudFront
strict-transport-security: max-age=63072000; includeSubdomains; preload
surrogate-control: no-store
via: 1.1 6a3d98aad6a6ea4a9a35b5590bdb3da6.cloudfront.net (CloudFront)
x-amz-cf-id: Kk_OJ81EaGL6zbFLPY2CWOdwscnjtEIwV0a91AhWVxLKZTW8qlmWaQ==
x-amz-cf-pop: MRS52-P1
x-cache: Miss from cloudfront
x-powered-by: Express

Responses
Code Description Links

200 No links
Get the user profile details

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"username": "string",

"password": "string",

"createdAt": "2022-04-22T05:54:41.157Z",

"updatedAt": "2022-04-22T05:54:41.157Z"

GET /api/users Get the list of users.

Get the list of users.

Parameters Cancel

No parameters

Execute Clear

Responses

Curl

curl -X 'GET' \
'https://dna-assets-truewiser.alpha.mckinsey.digital/api/users' \

-H 'accept: application/json' \

-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjUsInVzZXJuYW1lIjoic

Request URL

https://dna-assets-truewiser.alpha.mckinsey.digital/api/users

Server response

Code Details
Code Details

200
Response body
{

"id": 6,

"username": "John5"

},

"id": 5,

"username": "shubham"

},

"id": 4,

"username": "string"

},

"id": 3,

"username": "pushya"

},

"id": 2,

"username": "priyanka_admin"

},

"id": 1,

"username": "tw_admin"

Download
]

Response headers

access-control-allow-origin: *
cache-control: no-store
content-length: 185
content-type: application/json; charset=utf-8
date: Fri,22 Apr 2022 05:40:52 GMT
etag: W/"b9-vPR3NJN2pgIOI/nOnBEuIi6rrwI"
expires: 0
pragma: no-cache
server: CloudFront
strict-transport-security: max-age=63072000; includeSubdomains; preload
surrogate-control: no-store
via: 1.1 6a3d98aad6a6ea4a9a35b5590bdb3da6.cloudfront.net (CloudFront)
x-amz-cf-id: hl-nzzlw74V-3BgS5yAVZyaoxWzY6c_EM5vvpBHghT_hlxBkLy3FLA==
x-amz-cf-pop: MRS52-P1
x-cache: Miss from cloudfront
x-powered-by: Express

Responses

Code Description Links


Code Description Links

200 No links
Get the list of users.

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"username": "string",

"password": "string",

"createdAt": "2022-04-22T05:54:41.159Z",

"updatedAt": "2022-04-22T05:54:41.159Z"

POST /api/users/{userId}/profile Create new user profile

Create new user profile

Parameters Cancel Reset

Name Description

required
userId *
number 1
(path)

required
Request body application/json

"email": "test@mail.com",

"age": 0,

"maritalStatus": "MARRIED",

"kids": [

"string"

],

"dualIncome": true,

"income": 0,

"spouseIncome": 0,

"nationalIdNo": "string",

"allowCreditCheck": true,

"createdAt": "2022-04-22T05:41:26.770Z",

"updatedAt": "2022-04-22T05:41:26.770Z"

}
Execute

Responses

Code Description Links

200 No links
Create new user profile

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"occupationalDetail": "SALARIED_PROFESSIONAL",

"isHealthInsurance": true,

"isLifeInsurance": true,

"healthInsuranceAmount": 0,

"lifeInsuranceAmount": 0,

"createdAt": "2022-04-22T05:54:41.163Z",

"updatedAt": "2022-04-22T05:54:41.163Z"

201 No links

POST /api/users/{userId}/profile/{profileId} Update the existing user profile by userId & profileId

Update the existing user profile by userId & profileId

Parameters Try it out

Name Description

required
userId *
number
userId
(path)

required
profileId *
number
profileId
(path)

required
Request body application/json

Example Value Schema


{

"id": 0,

"email": "string",

"age": 0,

"maritalStatus": "MARRIED",

"kids": [

"string"

],

"dualIncome": true,

"income": 0,

"spouseIncome": 0,

"nationalIdNo": "string",

"allowCreditCheck": true,

"createdAt": "2022-04-22T05:54:41.168Z",

"updatedAt": "2022-04-22T05:54:41.168Z"

Responses

Code Description Links

200 No links
Update the existing user profile

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"email": "string",

"age": 0,

"maritalStatus": "MARRIED",

"kids": [

"string"

],

"dualIncome": true,

"income": 0,

"spouseIncome": 0,

"nationalIdNo": "string",

"allowCreditCheck": true,

"createdAt": "2022-04-22T05:54:41.169Z",

"updatedAt": "2022-04-22T05:54:41.169Z"

201 No links

POST /api/users/{userId}/occupation Create new user occupation profile

Create new user occupation profile


Parameters
Try it out

Name Description

required
userId *
number userId
(path)

required
Request body application/json

Example Value Schema

"id": 0,

"occupationalDetail": "SALARIED_PROFESSIONAL",

"isHealthInsurance": true,

"isLifeInsurance": true,

"healthInsuranceAmount": 0,

"lifeInsuranceAmount": 0,

"createdAt": "2022-04-22T05:54:41.173Z",

"updatedAt": "2022-04-22T05:54:41.173Z"

Responses

Code Description Links

200 No links
Create new user ocuupation profile

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"occupationalDetail": "SALARIED_PROFESSIONAL",

"isHealthInsurance": true,

"isLifeInsurance": true,

"healthInsuranceAmount": 0,

"lifeInsuranceAmount": 0,

"createdAt": "2022-04-22T05:54:41.174Z",

"updatedAt": "2022-04-22T05:54:41.174Z"

201 No links

Update the existing user occupation profile by


POST /api/users/{userId}/occupation/{occupationId}
userId & occupationId
Update the existing user occupation profile by userId & occupationId

Parameters Try it out

Name Description

required
userId *
number
userId
(path)

required
occupationId *
number
occupationId
(path)

required
Request body application/json

Example Value Schema

"id": 0,

"occupationalDetail": "SALARIED_PROFESSIONAL",

"isHealthInsurance": true,

"isLifeInsurance": true,

"healthInsuranceAmount": 0,

"lifeInsuranceAmount": 0,

"createdAt": "2022-04-22T05:54:41.179Z",

"updatedAt": "2022-04-22T05:54:41.179Z"

Responses

Code Description Links


Code Description Links

200 No links
Update the existing user occupation profile

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"occupationalDetail": "SALARIED_PROFESSIONAL",

"isHealthInsurance": true,

"isLifeInsurance": true,

"healthInsuranceAmount": 0,

"lifeInsuranceAmount": 0,

"createdAt": "2022-04-22T05:54:41.180Z",

"updatedAt": "2022-04-22T05:54:41.180Z"

201 No links

POST /api/users/{userId}/finance Create new user finance profile

Create new user finance profile

Parameters Try it out

Name Description

required
userId *
number
userId
(path)

required
Request body application/json

Example Value Schema

"id": 0,

"monthlyExpenditure": 0,

"totalEmis": 0,

"valueOfInvestment": 0,

"currentBankBalance": 0,

"property": 0,

"car": 0,

"createdAt": "2022-04-22T05:54:41.184Z",

"updatedAt": "2022-04-22T05:54:41.184Z"

Responses

Code Description Links

200 No links
Create new user ocuupation profile

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"monthlyExpenditure": 0,

"totalEmis": 0,

"valueOfInvestment": 0,

"currentBankBalance": 0,

"property": 0,

"car": 0,

"createdAt": "2022-04-22T05:54:41.185Z",

"updatedAt": "2022-04-22T05:54:41.185Z"

201 No links

Update the existing user finance profile by userId &


POST /api/users/{userId}/finance/{financeId}
financeId

Update the existing user finance profile by userId & financeId

Parameters Try it out

Name Description

required
userId *
number
userId
(path)

required
financeId *
number
financeId
(path)

required
Request body application/json

Example Value Schema


{

"id": 0,

"monthlyExpenditure": 0,

"totalEmis": 0,

"valueOfInvestment": 0,

"currentBankBalance": 0,

"property": 0,

"car": 0,

"createdAt": "2022-04-22T05:54:41.189Z",

"updatedAt": "2022-04-22T05:54:41.189Z"

Responses

Code Description Links

200 No links
Update the existing user finance profile

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"monthlyExpenditure": 0,

"totalEmis": 0,

"valueOfInvestment": 0,

"currentBankBalance": 0,

"property": 0,

"car": 0,

"createdAt": "2022-04-22T05:54:41.190Z",

"updatedAt": "2022-04-22T05:54:41.190Z"

201 No links

GET /api/users/{userId}/download Download raw data for user

Download raw data for user

Parameters Try it out

Name Description

required
userId *
number userId
(path)
Responses

Code Description Links

200 No links
Download raw data for user

categories
Run & get financial health check for user for each
POST /api/categories/users/{userId}/report
category

Run & get financial health check for user for each category with userId

Parameters Try it out

Name Description

required
userId *
number
userId
(path)

Responses

Code Description Links

200 No links
Run & get financial health check for each category

201 No links
Media type

application/json
Controls Accept header.

Example Value Schema

{}

GET /api/categories/users/{userId}/report Get financial health check report for all categories

Get financial health check report for all categories for user with userId

Parameters Try it out

Name Description

required
userId *
number userId
(path)

Responses

Code Description Links

200 No links
Get financial health check report for all categories

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"userId": 0,

"categoryId": 0,

"score": 0,

"message": "string",

"recommendation": "GOOD",

"recommendationCount": 0,

"createdAt": "2022-04-22T05:54:41.197Z",

"updatedAt": "2022-04-22T05:54:41.197Z"

/api/categories/{categoryId}/users/{userId} Get financial report for a category for a


GET /report particular user

Get financial report for a category for a particular user with categoryId & userId

Parameters Try it out


Name Description

required
userId *
number userId
(path)

required
categoryId *
number categoryId
(path)

Responses

Code Description Links

200 No links
Get report for a category for a particular user

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"userId": 0,

"categoryId": 0,

"subCategoryId": 0,

"subCategoryAtttributeId": 0,

"score": 0,

"message": "string",

"recommendation": "GOOD",

"name": "string",

"createdAt": "2022-04-22T05:54:41.199Z",

"updatedAt": "2022-04-22T05:54:41.200Z"

Get recommendation count by user id for welcome


GET /api/categories/users/{userId}/summary
screen report

Get recommendation count by user id for welcome screen report

Parameters Try it out

Name Description

required
userId *
number userId
(path)
Responses

Code Description Links

200 No links
Get recommendation count by user id

Media type

application/json
Controls Accept header.

Example Value Schema

"recommendation": "GOOD",

"count": 0

GET /api/categories/download Download Persona & Formula Config files

Download Persona & Formula Config files

Parameters Try it out

No parameters

Responses

Code Description Links

200 No links
Download Persona & Formula Config files

POST /api/categories/upload Upload a file & dump data for user persona

Upload a file & dump data for user persona

Parameters Try it out


No parameters

Responses

Code Description Links

201 No links
Success for all the persona for which data update was successful

utils

GET /api/utils/query Query the database

Helper route to inspect the database

Parameters Try it out

No parameters

required
Request body application/json

Example Value Schema

"query": "string"

Responses

Code Description Links


Code Description Links

200 No links
Raw response

Media type

application/json
Controls Accept header.

Example Value Schema

"string"

mails

GET /api/mails/auth/user/{userId} Generate Auth URL for validating the email id.

Generate Auth URL for validating the email id.

Parameters Try it out

Name Description

required
userId *
number
userId
(path)

Responses

Code Description Links


Code Description Links

200 No links
Generate Auth URL for validating the email id.

Media type

application/json
Controls Accept header.

Example Value Schema

"string"

Redirect URL once the authorization recieved by user & generates the
GET /api/mails/redirect
access_token

Redirect URL once the authorization recieved by user & generates the access_token

Parameters Try it out

No parameters

Responses

Code Description Links

200 No links
Redirect URL once the authorization recieved by user & generates the
access_token

Media type

application/json
Controls Accept header.

Example Value Schema

"string"

GET /api/mails/user/{userId} Get all attachment details for the user.

Get all attachment details for the user


Parameters Try it out

Name Description

required
userId *
number
userId
(path)

Responses

Code Description Links

200 No links
Get all attachment details for the user.

Media type

application/json
Controls Accept header.

Example Value Schema

"id": 0,

"userId": 0,

"filename": "string",

"extension": "string",

"location": "string"

/api/mails/user/{userId}/attachment Download attachment for specific userId &


GET /{attachmentId} attachmentId.

Download attachment for specific userId & attachmentId.

Parameters Try it out

Name Description

required
userId *
number userId
(path)

required
attachmentId *
number
attachmentId
(path)
Responses

Code Description Links

200 No links
Download attachment for specific userId & attachmentId.

Schemas

HealthDTO {
status* string

example: HEALTHY
}

AuthLoginDTO {
username* string
password* string
}

UserDTO {
id number
username* string
password* string
createdAt* string($date-time)
updatedAt* string($date-time)
}

UserProfileDTO {
id number
email* string
age* number
maritalStatus* string
Enum:
Array [ 3 ]
kids*
[...]
dualIncome* boolean
income* number
spouseIncome* number
nationalIdNo string
allowCreditCheck boolean
createdAt* string($date-time)
updatedAt* string($date-time)
}
UserOccupationDTO {
id number
occupationalDetail* string
Enum:
Array [ 4 ]
isHealthInsurance* boolean
isLifeInsurance* boolean
healthInsuranceAmount* number
lifeInsuranceAmount* number
createdAt* string($date-time)
updatedAt* string($date-time)
}

UserFinanceDTO {
id number
monthlyExpenditure* number
totalEmis* number
valueOfInvestment* number
currentBankBalance* number
property* number
car* number
createdAt* string($date-time)
updatedAt* string($date-time)
}

CategoryRecommendationDTO {
id number
userId number
categoryId number
score* number
message* string
recommendation* string
Enum:
Array [ 4 ]
recommendationCount* number
createdAt* string($date-time)
updatedAt* string($date-time)
}

SubCategoryAndAttrRecomDTO {
id number
userId number
categoryId number
subCategoryId number
subCategoryAtttributeId number
score* number
message* string
recommendation* string
Enum:
Array [ 4 ]
name* string
createdAt* string($date-time)
updatedAt* string($date-time)
}
SubCategoryAndAttrRecomCountDTO {
recommendation* string
Enum:
Array [ 4 ]
count number
}

QueryDTO {
query string
}

AttachmentDTO {
id number
userId number
filename string
extension string
location string
}

You might also like