Update
/api/v2/room/update
Post
rooms
jwt
Purpose
To allow a user to update an existing chat room.
Body Content [input]
{
uid: string,
roomID: string,
name: string,
description: string,
icon: string,
privacy: string
}
Returns if valid [output]
{
message: string,
error: 0
}
What the API does
- Finds the
room
being referenced by theroomID
passed [404]. - Ensures that
uid
corresponds to a record in themembers
field with astatus
ofaccepted
and has a value oftrue
for itsis_admin
field [403]. - Updates and saves the
room
with the new value(s) forname
,description
,icon
and/orprivacy
. - Generates and saves a new object in the
messages
field of theroom
usingmessageID
, “Some details about this room have been updated” asmessage
,timestamp
ascreated_on
andmodified_on
, “_system” assenderID
,false
foris_deleted
and an empty array forviews
ifoperation
is set toblock
.