I might be missing something really simple but don't seem to find the solution.
I have created a quick and simple app which is meant to do some processing every morning and then send some logs to Slack.
I have been perfectly able to do so using Incoming Webhooks. Cool. The "problem" is that it requires me to set it up from the app settings (aka it obviously makes me define a specific channel for the Webhook so I can have the specific URL) and that's something I like a bit less.
I thought it'd be easier if I can just add/integrate the app on a channel using the Slack UI so I don't have to worry about having to know beforehand the channel(s) ID where the message has to go to and also any other user would be able to integrate in any other channel they consider.
I have integrated it on my testing channel (all good) and tested chat.postMessage (all good) but it still needs the channel (obviously). However, using conversations.list lists ALL channels and that's the opposite of what I'm looking for.
I need a way of getting just those channels where the app is integrated so I can post the message to those and only those.
Is this something that Slack doesn't allow or I'm just missing something very obvious here?
I hope it makes sense and someone can shed some light on this :)
You can use users.conversations method to get list conversations the calling user/bot may access.
https://api.slack.com/methods/users.conversations
Use Bot token to call the API.
Use type argument to search public, private, mpim & im conversations
https://api.slack.com/methods/users.conversations#arg_types
Mix and match channel types by providing a comma-separated list of any combination of public_channel, private_channel, mpim, im
Related
I need to implement Slack user/channel suggestions dropdown to share something using the user's Slack token. And (AFAIK) Slack doesn't provide any search-by-name features, so the only way is to implement it ourselves.
Currently, I'm thinking of pushing all public channels (most likely, I will have to figure out how to do the same for private ones) and users' data into something like Elastic. And use Slack Events to keep it up-to-date.
Are there any best practices for this task? I'm pretty sure it's a more or less a trivial problem, and I'm not the first one who needs to implement such a solution - but surprisingly enough, I didn't find any off-shelf solutions to this problem
Have you considered using Slack's Block Kit feature? It offers both a conversations-select and a users-select dropdown menu that you can embed into messages.
https://api.slack.com/reference/block-kit/block-elements#select
Trying to parse through the Microsoft Documentation of this is a bit of a challenge.
Our use case is that we want the app to receive broadcasts from an external service. On that broadcast we want it to send a personalized message to every person in the team/org.
Is that at all possible? Doing this in Workplace and Slack was fairly straight forward but i'm going nowhere fast with Teams. Connectors seem weird and user-based, not team based, requiring you to set up a config page for it? Bots seem centered around AI interactions and on demand features and general apps? Not sure.
So yea the question is, is it possible. If so i would appreciate to know where to look for how to do this.
Yes, this is definitely possible. If you're wanting to send to a Team (i.e. a Channel within a Team) you can use either a bot or a webhook. If you want to send to individuals or to group chats, then you'd be looking to use a bot.
For webhooks, see Post external requests to Teams with incoming webhooks. For bots you can start here, and in that case you'd want to look into something called "Pro-active messaging", where the bot is sending a message on it's own, rather in response to a user's initial message.
The Pro-active messaging can be a bit tricky, so if you do want to go that approach (1 to 1 messaging), let me know in the comments and I give you some more guidance. However, I'd suggest rather looking at messaging the Team, and creating/using a relevant channel, rather than sending every user a 1-1 message.
I am working on a POC to proof out the ability to get a list of all the new users who have been added to a specific Slack Channel. From my initial review of the Slack API I am not seeing anything that showcases this ability, I was curious to see if anyone had worked on something similar or could point me to resources that would be a viable solution.
I believe there is no ready-made API method available, that will give you that specific information. However, Slack is very flexible and you can use the existing building blocks to easily add additional features as needed.
E.g. To get the requested information you can develop a small Slack app that listens to the member_joined_channel and member_left_channel events to keep track of when members joined a channel.
If you need a historical record of membership in a channel, you could use the Slack API's groups.history method, page through results, and build a membership log by looking for events of type member_joined_channel and member_left_channel through time.
According to the Slack docs, I should use <#W123> syntax. However, this turns into #joe, which alerts joe that someone messaged them. Is there any syntax like <W123> that resolves to just the user's display name?
(I am aware that I could use user.info, but so far I've avoided making any API calls and I was hoping I could keep that going.)
Got a response from #SlackAPI on Twitter. Unfortunately, there is no markdown-y way to do this. On the plus side, they have a good sense of humor.
I've recently started to use Twilio, for our own needs - we need to provide users with real-time informations about possible dangerous events that might have happened at their home, through SMS or Voice call.
I've tried to use VoiceCall exactly as it's specificied here - https://www.twilio.com/user/account/developer-tools/api-explorer/call-create. The scenario is that I want a robotic voice to explain what was happened, hence I need to generate the xml file for voice on demand. I supplied my own RestApi url for the voice, that is able to generate this file through TWIML.
By default Twilio, will use that url to fetch the audio and other instructions, at the moment when the call is performed. Since the voice URL cannot contain parameters (because they got cut off for some reason) (e.g YES - http://mywebsite.com/api/sayVoice, NO - http://mywebsite.com/api/sayVoice?eventId=1), you will ALWAYS get the same audio (no way to identify a different kind of event and generate a DIFFERENT xml output (for a different audio to the end user).
In Twilio documentation examples, they have only static URLs as well, without extra parameters, hence is that indeed the only way Twilio Call Api can be used?
It's hardly believable that such an use case was not planned for Twilio.
Did anyone tried to use Twilio for a similar scenario?
Any suggestions regarding similar technologies for the same purpose?
Found the issue in the end, you need to pass the parameters as RequestParams.
For example, this one will work - Url=http://mywebsite.com/api/twilio/sayVoice?eventId=379, while pathParam won't work Url=http://mywebsite.com/api/twilio/sayVoice/379.
Hence, stay safe and use RequestParams.