slack-api

How to integrate internal APIs (Not accessible outside office network) to slack slash commands

六月ゝ 毕业季﹏ 提交于 2019-11-27 16:25:44
I am trying to use slash commands to my one of the slack channel. I tried to do a POC using git API and it worked fine. I first created a slash command from this link : https://api.slack.com/censored/slash-commands Commnad: /poc Request URL: http://jsonplaceholder.typicode.com/posts This worked fine when I type /opc on slack chat box of my channel. It returns some data. But when I change the Request URL to an internal API, which is accessible only from the office domain, I get error: Darn – that slash command didn't work (error message: Failure when receiving data from the peer ). Manage the

How to upload any file on Slack via Slack-App in c#

血红的双手。 提交于 2019-11-27 16:25:21
I need help with uploading files to Slack. I have a Slack-App that is working with my code(below) so far. But all I can do is post messages. I can not attach images to the messages - because I do not understand how to use the so called "methods" and the syntax Slack is "showing" on their API-page. This creates my "content" and below its just a Stream for reading a file I could upload: public class PostMessage { public FormUrlEncodedContent Content(string message, string file) { var values = new Dictionary<string, string> { {"token", "xoxp-myToken"}, { "username", "X"}, { "channel", "myChannel"

Slack API team invitation

旧街凉风 提交于 2019-11-27 10:40:00
I am looking for a call which could send a Slack team invitation email to a new user from my application. I searched it in the SlackAPI but I didn't find anything. Is it possible to create an application which would sent invitations on my behalf? I'm currently using slacker as a Python wrapper, but if there is any better library which provides invitations I can start using it. Invite new users via API There is an undocumented method in the Slack API that allows you to programmatically invite new users to your Slack workspace: method name: users.admin.invite arguments: token , email , channels

How to replace the buttons (attachment) only w/ Slack interactive buttons response

坚强是说给别人听的谎言 提交于 2019-11-27 09:40:31
I've managed to create a simple interactive button Slack app using a Google Apps Script (GAS). I know how to replace the original message w/ the response, but I would like to replace only the buttons, as demonstrated (but not clearly explained) multiple places in the Slack Interactive Button documentation: https://api.slack.com/docs/message-buttons#crafting_your_message I'd like to do what's demonstrated here: https://a.slack-edge.com/dcb1/img/api/message_guidelines/Example_6.gif Is this an update of the original message, a replacement of the original message with identical text but different

What is the simplest way to find a slack team ID and a channel ID?

北慕城南 提交于 2019-11-27 09:22:48
问题 We are trying to setup deep linking into slack, as described here: https://api.slack.com/docs/deep-linking The document states that to open a specific team, the following URL should be used: slack://open?team={TEAM_ID} Open Slack and switch teams to the specified team. The provided TEAM_ID should be a string, like T12345. Furthermore, to open a channel in a team, the following URL should be used: slack://channel?team={TEAM_ID}&id={CHANNEL_ID} Open the channel specified by the CHANNEL_ID

Slack PHP API - Avoid Timeout error

陌路散爱 提交于 2019-11-27 06:47:06
问题 I am trying to use Slack Custom command and not pretty sure how to use delayed messages since the Yoda Speak External API takes more than 3 seconds to respond. I have done the following: Sent the slack command /Yoda in my case and received the reponse_url . Used the following to post the following to the response URL. $data_string = '{"response_type": "in_channel", "text":"Checking,please wait..."}' ; $chs = curl_init(); curl_setopt($chs, CURLOPT_URL, $response_url); curl_setopt($chs, CURLOPT

Can i send custom properties/data in slack message attachments?

偶尔善良 提交于 2019-11-27 05:31:48
I want to send some custom properties in the attachment for interactive messages and retrieve them back in the action response. is there a way to do this? Yes, that is possible. However, it only works well for small sets of data. Assuming we are talking about buttons the normal approach would be to use the value field of an action to transfer custom data based on which button the user clicked back to your app. The field is a normal string within a JSON message, which is send by POST request to your app. So it can in principle contain a whole data set, not only a single value. All you need to

How to send direct messages to a user as app in app channel

有些话、适合烂在心里 提交于 2019-11-27 05:07:07
How is it possible to send message in slack directly to the user, by user.id as application. this application has scope: bot,channels:write,emoji:read,users:read,users:read.email I find how to send message only as DM or by webhooks, but there is no scope for that. Any one has idea? If I understand your question correctly, you want to send direct messages to users in the app channel instead of the standard slackbot channel. In order to do that you need to Your app needs the bot scope and a bot user Open a direct message channel from your app with the user with im.open . You get back a direct

How to upload any file on Slack via Slack-App in c#

淺唱寂寞╮ 提交于 2019-11-26 22:27:10
问题 I need help with uploading files to Slack. I have a Slack-App that is working with my code(below) so far. But all I can do is post messages. I can not attach images to the messages - because I do not understand how to use the so called "methods" and the syntax Slack is "showing" on their API-page. This creates my "content" and below its just a Stream for reading a file I could upload: public class PostMessage { public FormUrlEncodedContent Content(string message, string file) { var values =

Slack API team invitation

我的未来我决定 提交于 2019-11-26 18:56:32
问题 I am looking for a call which could send a Slack team invitation email to a new user from my application. I searched it in the SlackAPI but I didn't find anything. Is it possible to create an application which would sent invitations on my behalf? I'm currently using slacker as a Python wrapper, but if there is any better library which provides invitations I can start using it. 回答1: Invite new users via API There is an undocumented method in the Slack API that allows you to programmatically