1

I'm trying to include block kit interactive components such as textboxes and buttons in a slack message that is sent via the API.

The buttons work perfectly when the message is sent by the bot and not impersonates a real user. But when posting as a user (I.E. Setting set_user as true when calling the chat.postMessage API endpoint), the buttons show up but do not work.

It seems that slack does not make an HTTP request to the "Interactivity request URL" specified in the Slack App's configuration.

Has anyone managed to get it to work? Thanks

Zappatta
  • 422
  • 7
  • 15

1 Answers1

1

Do you mean to say the interactivity is not working when you use the as_user parameter on chat.postMessage? If that's the case then the issue is that this parameter, as_user is not supported for newer apps. In other words it's a legacy parameter that shouldn't be used. If you want your app to post as another user you will have to add the chat:write.customize scope. See the documentation about authorship.

sandra
  • 1,301
  • 3
  • 3
  • Thanks for the reply. So if I wish to send a message from an existing workspace member, I am supposed to provide username and icon_url identical to the member's? Will this message appear to recipient as a DM from the member? The documentation is somewhat vague on that. – Zappatta Jul 19 '22 at 08:59
  • 1
    Yes you would need to provide the username and icon url in the API call. If the intention is to send a DM, the DM conversation will still be the DM between the user and the app. It won't open the DM between the actual user you are posting as and the recipient. The API does not allow impersonation to that degree. – sandra Jul 19 '22 at 16:25