1

I want to reply in a slack thread via Slack API.

I have an object.

var msg = {
  text: 'test',
  thread_ts: '1513168789.000263' // it's right ts, I have checked 
}

I make the request

request.post({
  method: 'post',
  body: msg,
  json: true,
  url: '<incoming slack webhook>'
})

I expect to get the message to be replied in a thread, but it's just posted in a channel.

Amir Abdullaev
  • 141
  • 1
  • 1
  • 8

1 Answers1

3

You need to use chat.postMessage if you want to send messages to a thread. The incoming webhook will not work (or at least there is no information in the documentation that it would support it).

chat.postMessage has a property called thread_ts, which you can use to address the correct thread.

See also this answer about webhooks and threads.

Erik Kalkoken
  • 30,467
  • 8
  • 79
  • 114
  • 1
    "Post your message as a reply in a thread You can use Incoming Webhooks to make your message appear as a reply in a thread. Read our guide to threading messages to see the process." Source: https://api.slack.com/messaging/webhooks But you're right, there's no further documentation explaining how to do it. – SW_user2953243 Apr 02 '20 at 19:30