Upload Media Files to a Room

Prev Next
Post
/api/v1/rooms.media/{rid}

To upload media files to a room, follow these steps:

  1. Call this endpoint first. This endpoint uploads the file to the database and returns a file object with the file ID and URL data. Save the file ID, we will need this to send the file in the next step.
  2. To send the file to a room, use the Confirm Uploaded File endpoint.
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Path parameters
rid
stringRequired

The room ID.

Example674eca3e43725ce31dd9a2e8
Body parameters
object
file
string (binary) Required

The file to upload

msg
string Required

The text to be added to the file message.

Responses
200

OK

Example
{
  "file": {
    "_id": "67109d6c25682c7469486008",
    "url": "/file-upload/67109d6c25682c7469486008/Screenshot%202024-10-15%20at%2010.17.39.png"
  },
  "success": true
}
Expand All
object
file
object
_id
string
url
string
success
boolean