slack-api

Slack API (files.upload) using NodeJS

半腔热情 提交于 2019-12-01 01:14:05
问题 EDITED I'm trying to structure the files.upload() API provided via Slack but am having a hard time understanding the correct format. At the moment, I am able to use the API to upload a text file but cannot for the life of me figure out how to upload an image. Here's my issue: I have an image on my development server, let's call it image.png. I want to use the files.upload() API to post that image into a #general Slack channel. Below is the code I have that is successfully generating the image

Slack webhook - Which IPs should I open?

冷暖自知 提交于 2019-11-30 22:05:12
问题 We want to use Slack Webhook (Outgoing Webhook) with an internal web service. Our company is behind a firewall, so outside connections must be whitelisted. It appears that Slack has multiple addresses it will send the API request from, and they don't seem to be documented. Which IPs/Ports should we open in the firewall (whitelist) in order to allow slack's outgoing webhooks to connect to our internal web service? 回答1: An alternative could be using a VPN tunnel service to expose your internal

Is a Slack channel id unique across teams?

独自空忆成欢 提交于 2019-11-30 17:38:06
Is a Slack channel / group / im / mpim id unique across different teams? In other words, can two teams have channels with the same id? I read the docs, searched on Google and here on SO, but could not get confirmation if channel IDs are unique or not. Slack plans to clarify this in documentation soon. While in the present day you'd probably get by just fine assuming IDs are unique across different teams, we strongly recommend scoping all of your storage and retrieval by team ID. Essentially, we recommend considering IDs as only unique within teams, regardless of if experientially they are

How to get a slack user by email using users.info API?

泄露秘密 提交于 2019-11-30 17:27:04
I'm trying to use Slack's users.info API to retrieve users information, but I need to find users by email, is there a way to do that? Currently you can only look up users with users.info by their ID. An alternative solution to your problem would be to call users.list and filter within your client by the profile.email for whichever email you're looking for. Yes! https://slack.com/api/users.lookupByEmail Using this we can find a user if email id is available. More : https://api.slack.com/methods/users.lookupByEmail An undocumented API can do this job: https://slack.com/api/auth.findUser?team=

How to post a message via Slack-App from c#, as a user not App, with attachment, in a specific channel

点点圈 提交于 2019-11-30 09:37:29
问题 I can not for the life of me post a message to another channel than the one I webhooked. And I can not do it as myself(under my slackID), just as the App. Problem is I have to do this for my company, so we can integrate slack to our own Software. I just do not understand what the "payload" for JSON has to look like (actually I'm doing it exactly like it says on Slack's Website, but it doesn't work at all - it always ignores things like "token", "user", "channel" etc.). I also do not

Get a list of all private channels with Slack API

旧巷老猫 提交于 2019-11-30 03:19:10
问题 I've been trying to get a list of all "groups" in my Slack team. However, even with admin privs, groups.list only provides the groups that the token owner's account belongs to. The closest solution I've seen in my research involves getting a bot to sit in the channel. The bot's membership allows it to report on the channel, but then there's the logistical problem of getting the bot into every private channel, despite the fact that we can't list them programmatically. The code I've used to dig

How to get a slack user by email using users.info API?

老子叫甜甜 提交于 2019-11-30 00:34:16
问题 I'm trying to use Slack's users.info API to retrieve users information, but I need to find users by email, is there a way to do that? 回答1: Currently you can only look up users with users.info by their ID. An alternative solution to your problem would be to call users.list and filter within your client by the profile.email for whichever email you're looking for. 回答2: Yes! https://slack.com/api/users.lookupByEmail Using this we can find a user if email id is available. More : https://api.slack

How can I share my slack app between my workspaces?

China☆狼群 提交于 2019-11-29 15:11:05
I've just created an app (slash command) and install it in one of my workspaces. But now I want to add the same app to another one. Is it possible without distribution to App Directory? If you want to add you Slack app to another workspace, you can do so without going through the process of placing it on the App directory. All you need to do is add the ability to install your app to an workspace using OAuth 2.0. enable public distribution So instead of clicking "Install app to this workspace", which works great for private Slack app, which live in one workspace only, you need a script than can

Slack POST multiple messages to a channel at once

大兔子大兔子 提交于 2019-11-29 12:39:11
I need to post multiple bot replies (responses determined dynamically) to the same channel. The obvious way seems to be to do an HTTP POST for each message in succession using this API method: https://api.slack.com/methods/chat.postMessage Is there a way to send messages to Slack in bulk to post to the same channel? The order in which the messages get rendered need not be important for me. No, there is no bulk variant. So you basically need to build your own bulk message sender. Keep in mind that there is a request limit of 1 message per second or your API requests will fail. There also is a 3

Is it possible to post to chat.postMessage as any user in a Slack team?

穿精又带淫゛_ 提交于 2019-11-29 11:28:50
I'm building a Slack integration that is intended to modify some text and then post it to a Slack channel as though the user who triggered the command had said it. e.g. /makeFace disapproval @Ben 3:45pm ಠ_ಠ I ask for the client permission scope, which adds the chat:write:user permission. But when I hit the chat.postMessage endpoint, it only seems to allow you to post as the user who added the integration because the token it returns seems to be individuated for that user. I know that giphy, for instance, sends its gif messages as though you are the originator, but I can't find out how they