API - User

File Name: user.js
File Path: /server/routes/user.js
This route is used to handle end user related queries. For example: fetching single user details using phoneNumber, creating new user, fetch contact, update UserStatus, Upload ProfilePic, change ChatUrl etc.

  • Contents:
  • All User Details
  • Specific User Details
  • User Stats Details

All User Details

  1. API Path: api/admin/user
  2. Method: POST
  3. Description:
    • This route fetch user details , those which are registered with the vChatApp application.
    • Renders paginated data.
    • Functionality: ./controllers/user.js
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type Required
    name string true
    PhoneNumber String true
    Token String true

    Description: Response object returned to the api which contains user details.

  5. Response:

    • Returns object with four properties: success (bool), message , data and meta .
    • Data field is an array of user object containing all the details of the user.
    • Meta
      field contains fields related to pagination such as totalNoOfPages, currPageNo, limit etc.

    • Http Code: 200

      Name: returnObj

      Type: object

Specific User Details

  1. API Path: api/admin/users/checkContactExit
  2. Method: POST
  3. Description:
    • This route fetch contacts that saved phone abd return phoneNumber details
    • Requires UserphoneNumberas input parameter.
    • Functionality: ./controllers/user.js
  4. Parameters:

    Name req
    type object
    Contains params: {  array: userContact,   Type: array }
    • Name: res

      Type: Object

      Description: Response object returned to the api which contains array of object which contains phoneNumber details.

  5. Response:

    • Returns object with three properties: success(bool), message and data
    • Data : field is an object containing the details of requested user.

    • Http Code: 200

      Name: returnObj

      Type: array of Object

results matching ""

    No results matching ""