View
/api/v2/message/view
Post
rooms
jwt
Purpose
To allow a user to mark a sent message as being seen in a chat room that he/she is a member of.
Body Content [input]
{
uid: string,
roomID: string,
messagesID: string[]
}
Returns if valid [output]
{
message: string,
error: 0
}
What the API does
- Finds the record from the
roomscollection corresponding to theroomIDpassed [404]. - Ensures that
uidcorresponds to a record in themembersfield of that record with astatusofaccepted[403]. - Loop through all
messagesandthreadsin theroomand appendsuidto theirviewsfield if theirmessageIDorthreadIDis among the values of themessagesIDfield passed and ifuidis not already appended and ifuiddoes not have the same value as that of thesenderIDfield of that object.