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

  1. API Path: api/accountdetails
  2. Method: GET
  3. Description: This is a protected route which gets the accountdetail details through JWT access token which is provided in the header.
  4. 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

  1. API Path: api/accountdetails/:id
  2. Method: GET
  3. Description: This is a protected route which gets the accountdetail details through JWT access token which is provided in the header.
  4. Parameters:

    • jwtAccessToken: TRUE
    • In: Header,
    • Type: String,
    • Description: JWT access token is used to check the authenticity of the accountdetail.
  5. Response:

    • Http Code: 200
    • Data:{ }
    • Type: Object

    | Name | Type | | :--- | :--- | | statusCode | status | | Data | Object |

  6. 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

  1. API Path: api/accountdetails/:id
  2. Method: PUT
  3. Description: This is a protected route which update the accountdetail details.
  4. Parameters:

    • Name: req
    • Type: Object

    | FieldName | Type | | :--- | :--- | | user | ObjectId | | accountHolderName | String | | ifscCode | String | | bankAddress | String | | bankName | String | | primaryAccount | Boolean | | accountNumber | Number |

  5. jwtAccessToken: TRUE

  6. In : Header

  7. Type: String

  8. id: req.params.id

  9. 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

  1. API Path: api/accountdetails/:id
  2. Method: DELETE
  3. Description: Removes an accountdetail from the database.
  4. Parameters:

    • Name: req
    • Type: Object
  5. jwtAccessToken: TRUE

  6. In: Header

  7. 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.

results matching ""

    No results matching ""