Closed albertodiazdorado closed 2 years ago
Yes, you just need the ID of the message that started the thread. (https://github.com/RocketChat/Rocket.Chat/blob/develop/apps/meteor/app/lib/server/methods/sendMessage.js) Some lines refer to validations regarding tmid. tmid is the field that refers to the main message ID that opens the thread. Due to some internal reason, we have temporarily removed the documentation of this endpoint. We will soon be adding it to developer.rocket.chat
Nice, thanks! :D
So, for anyone hitting this thread, I will provide the meaningful information that you are looking for
response=$(curl -d '{"channel":"my-channel","text":"this is the main message"}' -H $user_header -H $token_header $rocketchat_url)
tmid=$(echo $response | jq .message._id)
curl -d '{"channel":"my-channel","text":"this goes to a thread","tmid":$tmid}' -H $user_header -H $token_header $rocketchat_url
I do not get why this is not the first example of the docs, but alas, here you go.
This is nowhere to be found in the documentation, although I would think that it is a very basic feature. Hence, I am wondering whether that feature is not documented, or whether it does not exist.
Is it possible to use the RocketChat API to write messages to a particular thread?