You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Slack has deprecated the "Incoming Webhooks" feature and is now encouraging everyone to switch to using Slack apps instead. Details are mentioned in the description here: https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
Here is a simple example I wrote to post messages using a Slack app and the Slack Rest API:
import os
import urllib3
http = urllib3.PoolManager()
# Note you will need to grab this and set it as a system environment variable
# Or, presumably, the payload coming from Splunk
token = os.environ['SLACK_BOT_TOKEN']
r = http.request(
'POST',
'https://slack.com/api/chat.postMessage',
headers = { 'Content-Type': 'application/json', 'Authorization': f'Bearer {token}' },
body = '{ "channel":"#general", "text":":slack: Web API test." }'
)
print(str(r.read()))
Here are the steps that I think will be needed to support this:
Add a new configuration option to the alert action called SLACK_APP_OAUTH_TOKEN or something similar.
Update the code to branch on whether a webhook or oauth token is provided. Or potentially release a new major version that breaks the incoming webhook configuration.
Update logic related to using a Slack app.
Update documentation to point to Slack app documentation.
If this isn't completed in the next few months (which is our timeline for switching to Slack apps), then I will come back and update myself. However, I'm filing this request early to see if anyone else wants to pick it up before I can.
Let me know if you need any more information.
Thanks!
The text was updated successfully, but these errors were encountered:
Slack has deprecated the "Incoming Webhooks" feature and is now encouraging everyone to switch to using Slack apps instead. Details are mentioned in the description here: https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
Here is a simple example I wrote to post messages using a Slack app and the Slack Rest API:
Here are the steps that I think will be needed to support this:
SLACK_APP_OAUTH_TOKEN
or something similar.If this isn't completed in the next few months (which is our timeline for switching to Slack apps), then I will come back and update myself. However, I'm filing this request early to see if anyone else wants to pick it up before I can.
Let me know if you need any more information.
Thanks!
The text was updated successfully, but these errors were encountered: