Rocket.chat: Rest API upload file get message

Created on 20 Mar 2019  路  4Comments  路  Source: RocketChat/Rocket.Chat

Hello,

I鈥檓 created a chat client into a custom app and using the rest api to communicate with RocketChat.

I am uploading files over the function "/api/v1/rooms.upload", but the return value of this call is only if it was successful or not. Is there any chance to get a message object with the attachment information鈥檚? Because I want to show the uploaded file at the messages in my app.

At this time I create a message object in the frontend, but I think that is not the best way to show the uploaded file as a message.

Bye Andreas H.

Most helpful comment

@knrt10 I think it is fine to return the message object :+1:

All 4 comments

@AndreasHo you are right I think we should return message object too. It just return return API.v1.success();currently. Let see what others think of this. If approved, I will make a fix for this.

cc @ggazzo @tassoevan @sampaiodiego should we send message object back on file upload via API?

@knrt10 I think it is fine to return the message object :+1:

Ok, will make a PR for this.

@sampaiodiego while we are on this, should there be the endpoint for getting file Data? Currently, there is not. Like rooms.upload/:id

Was this page helpful?
0 / 5 - 0 ratings

Related issues

karlprieb picture karlprieb  路  3Comments

brendanheywood picture brendanheywood  路  3Comments

marceloschmidt picture marceloschmidt  路  3Comments

tanc picture tanc  路  3Comments

ghost picture ghost  路  3Comments