Creating a Slack app that uses Webhooks to send messages to a channel
May 12, 2020
Create an app
-
Create a new slack app https://api.slack.com/apps?new_app=1 or https://api.slack.com/start
-
Activate Incoming Webhooks
-
Add new Webhook URL for Channel (could be #channel, @username)
-
(Optional) Add an icon (less than 16mb, between 500x500px and 2000x2000px) https://api.slack.com/apps/XXXXXXXX/general?
Settings > Basic Information > Display Information
Sending messages
Once you have the webhook URL, you can try it out by sending it sample data
code
curl -X POST -H 'Content-type: application/json' --data '{"text":"Hello, World!"}' https://hooks.slack.com/services/XXXXXX/YYYYYY/XyXyY123xxxY
This will post a fairly straight forward Hello, World! message to your channel

Customizing message layout
Block kit