Using Slack, how do you send direct message to user based on their "Member ID?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 10:51:26

问题


How do you send a direct message to a user in Slack, using their unique "Member ID". Slack seems to only accept a Slack handle as an acceptable username.

I'm new to Slack and thanks in advance for the help (please let me know if this needs to be moved, etc.).


回答1:


Assuming you meant user ID when you said "member ID", you can use that as channel parameter in chat.postMessage to send a direct message to that user.

Example for user with User ID U12345678:

curl -X POST "https://slack.com/api/chat.postMessage" -H  "accept: application/json" -d token=TOKEN -d channel=U12345678 - d text=Hello


来源:https://stackoverflow.com/questions/48347073/using-slack-how-do-you-send-direct-message-to-user-based-on-their-member-id

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!