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, loading more messages etc
Fetch Users and Messages
GET
/api/messages/usersMessages
Fetches the users's chat list (named as Favourites) of users and messages
Headers
Name
Type
Description
Authorization
string
Authentication Token
Fetch Specific User Messages
GET
/api/messages/?id=${_id}
Headers
Name
Type
Description
Authorization
string
Authentication Token
Load More Messages
GET
/api/messages/loadMoreMessages
this loads the messages when user scrolls for older messages. initially only 20 messages are loaded.
Headers
Name
Type
Description
msgBody
object
msgBody contains length (messages length), userId, receiverId.
Authorization
string
Authentication Token
Last updated
Was this helpful?