slack-api

How to install bot in multiple teams without adding it to the directory?

那年仲夏 提交于 2019-12-03 06:33:37
I just finished creating my first slack bot in my dev slack team using the Microsoft bot framework. Now I would like to add the bot to another team for testing. My bot is not going to be for public use, just internal to the company. I tried use the Add to Slack button to add it to the new team but I get an : OAuth Error: invalid_team_for_non_distributed_app. Thanks. You need to go to settings of your app ( https://api.slack.com/apps/ → Your app name → Manage distribution) and activate public distribution of your app. This will not add your app to public directory, so only teams with link from

How to set slack reminder for private channel

元气小坏坏 提交于 2019-12-03 06:28:26
问题 I am able to set slack remider using /remind #public-channel but for private channel there is no option. 回答1: Found a solution for this. In case of a private-channel you can use slack inbuilt /remind command in following way: /remind @channel every weekday at 2pm to start daily standup. Here you can use either @here (to remind only online people) or @channel (remind everyone in the channel irrespective they are online). This was a nifty trick I used with my private slack channel. Wont find it

Sending JSON to Slack in a HTTP POST request

天涯浪子 提交于 2019-12-03 04:06:30
问题 I'm trying to send a message using Slack's chat.postMessage API call. I have no problems encoding my test messages within HTTP GET, but I'm trying to achieve the same result with JSON in a HTTP POST request. I've been testing with both curl and Postman, but Slack doesn't seem to be acknowledging my request body at all. { "ok": false, "error": "not_authed" } In curl , my request is encoded like this: curl -H "Content-type: application/json" -X POST -d '{"token":"my-token-here","channel":"

How to scale a slack bot to 1000's of teams

荒凉一梦 提交于 2019-12-03 03:33:57
To implement a slack bot, i need to deal with 'Real Time Messaging API' of slack. It is a WebSocket-based API that allows you to receive events from Slack in real time and send messages as user. more info: https://api.slack.com/rtm To create a bot for only one team , i need to open one websocket connection and listen it for events. To make available the slack bot for another team. I need to open a new websocket connection. So, 1 team => 1 websocket connection 2 teams => 2 websocket connections N teams => N websocket connections what should i do to scale my websocket connections for endless

Only Primary Owner can post Message on Slack

倾然丶 夕夏残阳落幕 提交于 2019-12-02 20:47:32
问题 I have a Slack App and Workspace. Since I am the admin, I can post the message to anyone and to any channel. But, when I am trying to post a message as a different user through an api call using the method chat.postMessage, it gives me the following response. {"ok":false,"error":"missing_scope","needed":"chat:write:user","provided":"identity.basic,identity.email,identity.avatar,identity.team","warning":"missing_charset","response_metadata":{"warnings":["missing_charset"]}} I checked the Oauth

How to set slack reminder for private channel

杀马特。学长 韩版系。学妹 提交于 2019-12-02 19:55:19
I am able to set slack remider using /remind #public-channel but for private channel there is no option. Pikachu-go Found a solution for this. In case of a private-channel you can use slack inbuilt /remind command in following way: /remind @channel every weekday at 2pm to start daily standup. Here you can use either @here (to remind only online people) or @channel (remind everyone in the channel irrespective they are online). This was a nifty trick I used with my private slack channel. Wont find it on slack documentation but it works. egervais7 I was able to set the reminder for the private

Sending JSON to Slack in a HTTP POST request

天大地大妈咪最大 提交于 2019-12-02 17:26:13
I'm trying to send a message using Slack's chat.postMessage API call. I have no problems encoding my test messages within HTTP GET, but I'm trying to achieve the same result with JSON in a HTTP POST request. I've been testing with both curl and Postman , but Slack doesn't seem to be acknowledging my request body at all. { "ok": false, "error": "not_authed" } In curl , my request is encoded like this: curl -H "Content-type: application/json" -X POST -d '{"token":"my-token-here","channel":"#channel-name-or-id","text":"Text here.","username":"otherusername"}' In Postman, this is the raw body: {

Only Primary Owner can post Message on Slack

安稳与你 提交于 2019-12-02 08:07:10
I have a Slack App and Workspace. Since I am the admin, I can post the message to anyone and to any channel. But, when I am trying to post a message as a different user through an api call using the method chat.postMessage, it gives me the following response. {"ok":false,"error":"missing_scope","needed":"chat:write:user","provided":"identity.basic,identity.email,identity.avatar,identity.team","warning":"missing_charset","response_metadata":{"warnings":["missing_charset"]}} I checked the Oauth and Permissions page on Slack and I have the scope as chat:write:user. I cannot figure out what to do

Slack API send commands via webhook

我与影子孤独终老i 提交于 2019-12-02 06:02:09
问题 I am not sure if what I am trying to do is even possible. I have a Slack App and via that SlackApp I want to control another Slack App which is not mine. That's probably too abstract, so let's get into detail: There is the SlackApp Foodtrain. If you are a user you just type "/lunchtrain Location Time" and it does it's job. I want my App to activate a Lunchtrain but if I just send a Message via Webhook thats '/lunchtrain Location Time' it doesn't activate the command. You can see it in

How to use the permalink_public URL of an uploaded image to include it in a message?

我们两清 提交于 2019-12-02 04:12:10
问题 I am trying to upload an image to slack and post it in an image block of a slack message to a specific channel. upload an image to Slack. make the image public with files.sharedPublicURL check if the url is public: public_url_shared being true . use the permalink_public I receive for the uploaded image for creating the slack message (an image block). for debugging I am using Slack's Block Kit Builde. I am replacing the URL in the image_url example of the block kit demo with the one I received