Routes : AccountDetail
File Name : accountdetail.js
File Path : server/routes/api/accountdetail.js
Contains route which create, update, view and delete the user details. These functionalities are included in AccountDetail Controller.
Post Accountdetails Route
1.API Path:
api/accountdetails/
2.Method:
POST
3.Description:
AccountDetail route is used to register a new user. AccountDetail can be either a Rider or a Driver. This route also checks if user has already have an account or not.
4.Parameters:
FieldName: req,
Type: Object,
jwtAccessToken: TRUE,
In: Header,
Type: String,
Description: JWT access token is used to check the authenticity of the accountdetail.
| FieldName | Type | Required |
|---|---|---|
| accountHolderName | String | true |
| ifscCode | String | true |
| bankAddress | String | true |
| bankName | String | true |
| primaryAccount | Boolean | true |
| accountNumber | Number | true |
| user | ObjectId | true |
Response:
Returns an object with properties: success (bool), Data.
Http Code:200
Data:{ }
Type: Object
| Name | Type |
|---|---|
| statusCode | status |
| Data | Object |
Description: Data is an object with an accountdetail.
Get AccountDetail Details Route
- API Path: api/accountdetails
- Method: GET
- Description: This is a protected route which gets the accountdetail details through JWT access token which is provided in the header.
Parameters:
- jwtAccessToken: TRUE
- In: Header,
- Type: String,
- Description: JWT access token is used to check the authenticity of the accountdetail.
Response:
Http Code: 200
Data:[ ]
Type: Array
| Name | Type |
|---|---|
| statusCode | status |
| Data | Array |
Description: The response object which gets you the accountdetail details.Data is an array with all accountdetail.
Get AccountDetail(particular user) Details Route
- API Path: api/accountdetails/:id
- Method: GET
- Description: This is a protected route which gets the accountdetail details through JWT access token which is provided in the header.
Parameters:
- jwtAccessToken: TRUE
- In: Header,
- Type: String,
- Description: JWT access token is used to check the authenticity of the accountdetail.
Response:
- Http Code: 200
- Data:{ }
- Type: Object
| Name | Type | | :--- | :--- | | statusCode | status | | Data | Object |
Description: The response object which gets you the accountdetail details of particular user.Data is an object with an accountdetail.
Update AccountDetail(particular user) Details Route
- API Path: api/accountdetails/:id
- Method: PUT
- Description: This is a protected route which update the accountdetail details.
Parameters:
- Name: req
- Type: Object
| FieldName | Type | | :--- | :--- | | user | ObjectId | | accountHolderName | String | | ifscCode | String | | bankAddress | String | | bankName | String | | primaryAccount | Boolean | | accountNumber | Number |
jwtAccessToken: TRUE
In : Header
Type: String
id: req.params.id
Description: JWT access token is used to check the authenticity of the accountdetail.
Response:
- Http Code: 200
- Data:{ }
- Type: Object
| Name | Type |
|---|---|
| statusCode | status |
| Data | object |
Description: Data is an object with an accountdetail.
Delete AccountDetail(particular user) Details Route
- API Path: api/accountdetails/:id
- Method: DELETE
- Description: Removes an accountdetail from the database.
Parameters:
- Name: req
- Type: Object
jwtAccessToken: TRUE
In: Header
Type: String
8.id: req.params.id
Response:
- Http Code: 204
- Data:{ }
- Type: Object
| Name | Type |
|---|---|
| statusCode | status |
| Data | blank Object |
Description: Data is an object with an accountdetail.