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
- API Path: api/admin/user
- Method: POST
- Description:
- This route fetch user details , those which are registered with the vChatApp application.
- Renders paginated data.
- Functionality:
./controllers/user.js
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.
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
- API Path: api/admin/users/checkContactExit
- Method: POST
- Description:
- This route fetch contacts that saved phone abd return phoneNumber details
- Requires UserphoneNumberas input parameter.
- Functionality:
./controllers/user.js
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.
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