I am building a slack application.
I added "incoming-webhook" to oauth scopes that let me choose the channel I want the App to post messages. However unless I ping the app in the channel to add it. I get a "channel not found" error.
Is it possible to add the app to a channel when installing app via oauth ? Without adding it manually by #app-name or /invite app-name ?
When you add an incoming-webhookscope to your app, the option to add a channel during authentication is specific to incoming webhooks not bot messages. So any messages you send via the incoming webhook will send to the channel you selected during authentication. Messages sent via [chat.postMessage][1] will require your bot to be a member of the destination channel, via invite. Incoming webhooks can only be linked to a single channel. You will have to create a new webhook for every channel you want to post to using webhooks. For that reason, I'd recommend using chat.postMessage instead. If you request the chat:write.public scope your bot will be able to post into any public channel without invitation.
Related
I would like to send messages to users through Slackbot, just like integration apps such as Zapier.
If I set the channel ID to the user ID it sends a 1:1 message showing up in the Apps tab, but what I really would like to do is to send a message in Slackbot, as I want to create a seamless experience for a Workflow I'm creating.
Then, if I try adding the Slackbot channel ID it returns channel_not_found and there's no way to add the App there.
My current bot token scope to send messages is: chat:write and I'm sending a message using chat.postMessage
Do I need a different scope? Different API method? I've tried going through some other questions/answers, but they look outdated
I'm building a Slack app using Bolt (currently hosted by Glitch). When a user adds my app to his channel, I want my app to discover the incoming webhook URL so I can send it off to another app which will post information to that URL.
I've tried (as someone suggested) subscribing to the 'member_joined_channel' event, but the event is not driven when the app is added to the channel.
I have a lot of questions about getting started. I currently have a sample bot I built in Composer that works for my teams/slack channels and works in the testing Bot Framework Emulator without issue.
I am not sure how to make the bot send a direct message/private message to a user in a channel instead of it replying directly in the channel itself. Any one have any ideas of how to accomplish this?
You can send messages from the bot to any user (or channel) by using the Azure Bot Service REST API (using the Send an HTTP Request action in Composer as described here. As you'll see in the documentation, the main limitation is that the recipient must have had a previous conversation with your bot from which you've recorded the conversationID (and activityID if you want to reply to a thread).
I need to send the multiple bot replies to the same channel. using this API method: https://api.slack.com/methods/chat.postMessage
But when i am sending multiple messages, The order in which the messages get rendered is not in the correct order, is there anyway to fix this.
I'm working on a new Workspace app for Slack. I have a use case where I need to send notifications to users in Slack, through a direct message (or IM). Since the chat.postMessage endpoint requires a channel ID, I can get the existing IM channels using conversations.list and send them the notification.
However, if the user hasn't yet opened an IM channel from their side, I need to create one. It seems that neither Web API endpoints (conversations.open or im.open) support Workspace tokens. I keep getting not_allowed_token_type error response. I can create a public channel with conversations.create, but that's not what I need.
Is there another to open an IM channel to a user when using a Workspace token?
Took me awhile to figure this out. You need to add/request the conversations.app_home:create scope to your permissions. Then you can just specify the user ID as the channel arg in a chat.postMessage call.