Link Search Menu Expand Document

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 the roomID passed [404].
  • Ensures that uid corresponds to a record in the members field with a status of accepted and has a value of true for its is_admin field [403].
  • Updates and saves the room with the new value(s) for name, description, icon and/or privacy.
  • Generates and saves a new object in the messages field of the room using messageID, “Some details about this room have been updated” as message, timestamp as created_on and modified_on, “_system” as senderID, false for is_deleted and an empty array for views if operation is set to block.