API - Messages

File Name: messages.js
File Path: /server/routes/messages.js
This route is used to handle user's chat (messages) related queries. For example: fetching favourite users and messages, fetching specific user messages.

  • Contents:
  • fetching favourite users and messages
  • fetching specific user messages

All User Details

  1. API Path: api/messages/usersMessages
  2. Method: GET
  3. Description:
    • This route fetch favourite users and messages, those which are registered with the vChatApp application.
    • Renders paginated data.
    • Functionality: ./controllers/messages.js
  4. Parameters:

    • Name: req
    • Type: Object
    Name Type Required
    token string true

    Description: Response object returned to the api which contains favourite users and messages.

  5. Response:

    • Returns object with four properties: success (bool), message , data and meta .
    • Data field is an array of favourite users and messages object containing all the details perivious chat and messages.

    • Http Code: 200

      Name: returnObj

      Type: array

fetching specific user messages

  1. API Path: api/messages/?id=${receiverID}
  2. Method: GET
  3. Description:
    • This route fetch userSppecific messages
    • Functionality: ./controllers/messages.js
  4. Parameters:

    Name req
    type object
    Contains Authorization: token
    • Name: res

      Type: Object

      Description: Response object returned to the api which contains object of messages.

  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: Object

results matching ""

    No results matching ""