Related to my assigned project, I wrote a bash script to implement the task.
For the user account and secret/hash creation part, the manager told me to find a way to send the user config file content directly to the individual user's slack(not a channel with a group of people in it). How to do that?.
I can see, search gives me the result of sending to slack channel using curl with short text messages.
I am not sure how to do the following:
Send a config file content to an individual user's slack.
Suppose, if the user account, password, hashes generated in the file /root/user_config. I want to send the file content to the individual user's slack(not channel or group).
From purely Slack Conversations perspective,
You need to DM the user using following APIs :
Open Conversation (Get DM Id):
https://api.slack.com/methods/conversations.open
Post Message using DM Id :
https://api.slack.com/methods/chat.postMessage
What data you need to send is up to you.
Related
I want to send message as DM to the users, so I've come with some questions;
1- There are two ways to send DM to the user;
the first one open a conversation with user by using conversation.open, and send message. Then if I want to send the message to the same user, I use conversation.list and find the conversationId by userId, then send message to the same channel again.
Second one is just basically using userId as channelId parameter in chatPostMessageRequest.
I've tried both ways, and both of them are sending message as DM. So, what is the purpose of using conversation.open? I'm asking this because nearly all the answers say you should do this etc.
2- Seems like there is no way to get multiple users by emails except users.list?
3- Also seems like there is no way to send messages to the multiple user at the same time (the content of the messages are different, those are depends on user data).
Sending a direct message by user ID works with chat.postMessage as a convenience, a shortcut. But it's the only method/API that allows you to use a user ID as a channel ID, so Slack warns developers away from relying on it in totality -- if you use conversations.open and the resultant conversation ID, it'll work for other methods like chat.update should you need to edit the message after sending it.
Slack doesn't offer many "lookup" APIs -- most things you'll want to look up require fetching an entire data set (like a list of users with all pages of users.list) and then filtering the results yourself. There are no APIs to look up multiple users at once via email address.
There is also no way to send the same direct message content to multiple users with a single request. In most cases, when an app is sending the same message to multiple users the best practice would be to use a channel to broadcast the message a single time, with the intended recipients as members of the channel.
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
When sending the response to a Slack slash command, I would like to send it under the user that has launched the slach command.
I have created a Slack app with a slash command. It calls my Flask webservice and I use the "response_url" webhook to write something back to the channel. The response in the channel is given by my app. This works as expected. But I would like for the response to be displayed as if a user has given it.
An example would be the Slack plugin from giphy. If I call it, I get an ephemeral message to choose the gif I would like. But then it is posted in the channel under my name.
So I have 2 questions:
How does the API call look like to respond to the slash command as a specific user?
What permissions for my app are required to allow for such behaviour of the app?
The Slack API documentation is comprehensive, but much research didn't yield the result I wanted.
Thanks!
When you are using response_url, you can't customize your username or icon. For this, you'll need to use chat.postMessage API method. There are now two ways to achieve what you need here:
Use user token: This gives you access to take actions on the behalf of the user. Although, you'll need to take authorization from every user you want post the message as.
Request chat:write.customize scope with your bot token: You can post a message with icon_url and username parameters where you can provide the user's icon and name respectively for both the parameters. This is much easier, as this only requires one-time authorization.
More information in the official documentation.
We are using the Direct Line API to carry conversations between an app and a bot. When we create a new conversation, we would like to include some metadata about the current user. The idea is that the bot would recognize the user and send a personalized message to the user. Is there a way have this behavior happen?
I am new at programming. I am building sort of like an chat app and I am using Parse as a backend. I want to make it possible for an existing user to send a message to a non existing user if the user knows the non existing-users email. The non-existing user will then get notified by the app on his email that this person send him a message and that he needs to sign up to read the message, and here is the question:
Does Parse makes it possible to chain this message to the non-existing users email, so that when he signs up in the app with this specific email the specific message to this email will display?
Thanks in advance.
No, not exactly.
You can create the user with the appropriate e-mail address and a made up password. Once that user exists (and hence is saved) you can start to associate things with it. After that you can send an e-mail to the prospective new user allowing them to complete the registration (this is basically a password reset).