Routes - Address

File Name : address.js
File Path : /server/routes/address.js
Address route contains saveAddress, getSaveAddress, updateAddress and deleteAddress . These functionalities are included in Address Controller.

Save Address Route

  1. API Path: api/address/saveAddress
  2. Method: POST
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type
    newAddress string
    active string
    houseNo string
    landMark string
    addressGpsLoc array
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object in which you can save the address details of the user.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data object

Get Save Address Route

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

    • Name: req
    • Type: Object

    • Name: jwtAccessToken

    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the save address details to the user.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data array

Update Address Route

  1. API Path: api/address/updateAddress
  2. Method: PUT
  3. Description: This is a protected route which gets the user details through JWT access token which is provided in the header.
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type
    newAddress string
    active string
    houseNo string
    landMark string
    addressGpsLoc array
    id string
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the updated address details to the user.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data object

Delete Address Route

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

    • Name: req
    • Type: Object
    Name Type
    addressId string
    • Name: jwtAccessToken
    • In: Header
    • Type: String
    • Description: JWT access token is used to check the authenticity of the user.
  • Name: res

    • Type: Object
    • Description: res is nothing but the response object which gets you the save address details except the deleted address to the user.
  • Response:

    • Http Code: 200
    • Name: returnObj
    • Type: Object
    Name Type
    success boolean
    message string
    data object

results matching ""

    No results matching ""