Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rooms.media API endpoint only upload file but does not send message #34956

Open
mkandel-lockself opened this issue Jan 17, 2025 · 6 comments
Open
Labels

Comments

@mkandel-lockself
Copy link

Description:

The rooms.media API endpoint does not send a message, but only uploads the file to the channel. Unlike rooms.upload, which does send a message but will be obsolete in version 8.0.0.

Steps to reproduce:

  1. Call rooms.media endpoint with a bot
curl -s --request POST \
    --url "https://<server>/api/v1/rooms.media/<rid>" \
    --header "X-User-Id: <X-User-Id>" \
    --header "X-Auth-Token: <X-Auth-Token>" \
    -F "file=@<filename>;type=text/plain" \
    -F "msg=foo"
  1. Open the channel page. You'll see the file in ... > Files but not the message in the feed.

Expected behavior:

A message sended with a notification like rooms.upload endpoint.

Actual behavior:

The file is uploaded but no message are sent.

Server Setup Information:

  • Version of Rocket.Chat Server: 7.0.0
  • Number of Users: 100
  • Deployment Method: Docker
  • NodeJS Version: 20.18.1
  • MongoDB Version: 7.0.15

Client Setup Information

  • Desktop App or Browser Version: 4.1.2 (desktop)
  • Operating System: MacOS

Additional context

I noticed in the code that for the rooms.media route there is no message sending, unlike the rooms.upload route.

@reetp
Copy link

reetp commented Jan 17, 2025

This isn't a really a bug but a feature request.

I'll try and ask for a comment why this has changed.

Don't expect a fast response.

@casalsgh
Copy link
Contributor

Asked internal engineers to take a look

@Per0x1de-1337
Copy link

Hey, I am currently working on this issue and want to clarify if
Do you want to enhance the current API ( rooms.media ) to perform two actions in a single API call - uploading a file to a channel and sending a message about that file upload in the same request? This would streamline the process and reduce the number of API calls needed for file sharing.

@mkandel-lockself
Copy link
Author

Hey, I am currently working on this issue and want to clarify if Do you want to enhance the current API ( rooms.media ) to perform two actions in a single API call - uploading a file to a channel and sending a message about that file upload in the same request? This would streamline the process and reduce the number of API calls needed for file sharing.

Hello, yes this is exactly what I want to do, just like the current API (rooms.upload) with the msg parameter.

@reetp
Copy link

reetp commented Jan 23, 2025

Hey, I am currently working on this issue

You should never start working on any issue until you have asked on open #support

Read all this please:

https://gist.github.com/reetp/b0ba4e3d0ea2ff48ca9da00a5a647d42#github

Note that Casals has referred this to the internal teams:

Asked internal engineers to take a look

You need to wait for the outcome of that first. This may be something they want fixed, it may be something they do themselves, or it maybe something they removed on purpose and do not intend fixing.

You'll just have to wait.

@Per0x1de-1337
Copy link

Hello, yes this is exactly what I want to do, just like the current API (rooms.upload) with the msg parameter.

I have implemented this locally.

Just let me know the what is the response of the internal engineers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants