💬 Chat App
Send message
This API endpoint enables logged-in users to send messages to a specific chat identified by the provided chatId in the path variable.
By making a POST request to this endpoint, developers can seamlessly integrate message transmission functionality into their applications, allowing users to engage in real-time conversations within the designated chat. User can send image files as attachments as well (maximum 5 attachments are allowed)
post/chat-app/messages/{chatId}
Response
Send message
Example response
{
"data": {
"_id": "64ce5da74c05d878da37e97f",
"attachments": [
{
"_id": "64ce5da74c05d878da37e980",
"localPath": "public/images/apple-fruit169124599101990191.jpg",
"url": "http://localhost:8080/images/apple-fruit169124599101990191.jpg"
},
{
"_id": "64ce5da74c05d878da37e981",
"localPath": "public/images/phone169124599104713451.jpeg",
"url": "http://localhost:8080/images/phone169124599104713451.jpeg"
},
{
"_id": "64ce5da74c05d878da37e982",
"localPath": "public/images/tire169124599107735823.jpeg",
"url": "http://localhost:8080/images/tire169124599107735823.jpeg"
}
],
"chat": "64cce34ddb940e1dd6232a3f",
"content": "This is the message",
"createdAt": "2023-08-05T14:33:11.125Z",
"sender": {
"_id": "64cc9951ea416ef275f0210f",
"avatar": {
"_id": "64ce5d481eb1fda995b9ed51",
"localPath": "public/images/apple-fruit169124589659630753.jpg",
"url": "http://localhost:8080/images/apple-fruit169124589659630753.jpg"
},
"email": "rasheed6@yahoo.com",
"username": "darrion_waelchi"
},
"updatedAt": "2023-08-05T14:33:11.125Z"
},
"message": "Message saved successfully",
"statusCode": 201,
"success": true
}