2 Question: I need a method to send a direct message to some user using excel

question created at Sat, Jun 1, 2019 12:00 AM

I need to find a method to use excel to send a direct message to slack user like we use MAilto in with subject and body function to send the user email,

for example (WhatsaApp)

api.whatsapp.com/send?phone=XXYYYYYYYYYY&text=This is my message

  1. You have informed us of your desire ( "I need ..." ), but have neglected to ask a question. Have you encountered any specific problem in writing the code that you need? If so, please show your code and ask a specific question about it. If you have written no code then this question is too broad, as Stack Overflow is neither a tutorial nor a free code-writing service. Please see How to ask a question on Stack Overflow.
    2019-06-01 07:57:56Z
  2. Hey and welcome to StackOverflow. Just to add what @Asger said. This website is not a coding service where you just put your request and people will do all the coding for you. But everyone is happy to help you with your own code, so just get started coding and feel free to ask questions here when you get stuck.
    2019-06-01 23:03:54Z
  3. Your question should be also helpful for others that might have a similar issue. Please either update your question (and answer) accordingly. Or consider deleting the question altogether. Thank you.
    2019-06-05 16:16:55Z
2 Answers 2

Well if i understand correctly, you want to get info from excel and send this info to a user, well that's possible in one way, you have to be able to read excel, which i don't recommend.

i recommend Google spreadsheet for that. anyway lets not get off-topic.

then you need to know how to send message to slack, Do you know ?

i will assume not, so to send messages there is two ways,

  1. Webhooks
  2. Web API

method URL = https://slack.com/api/chat.postMessage

to Send Through Web API, you have to pass the following arguments:

  1. token The Oauth2 Token you will get from slack when configuring your bot or app, Or you can use Legacy tokens instead

  2. channel The place you want to send the message, Channel ID if it is a channel, or User ID if it is a User.

  3. text As the name say, the message you want to send

  4. as_user Whether you want to send the message as your name or as a Custom name, This a boolean method, Means its Only True or False Note: To configure a custom name its in another argument we will reach.

  5. attachments A JSON-based array of structured attachments, presented as a URL-encoded string.

  6. username The name you want to appear as the sender of the message, only works if as_user is false, if as_user is true, it will ignore this argument.

Hope this help.

and please next time share a code so we can help, here there is not just 'I need...' its a place where you share code and then ask 'I need...' so we can help

2019-06-02 13:57:02Z

I have solved the issue already

Creating an APP and using the chat.postmessage

2019-06-02 20:07:22Z
  1. Good for you. But your answer does not solve your question, or help anyone else who has the same problem.
    2019-06-05 16:15:41Z
source placed here