Send messages to Slack using Python
Hello everyone! This post will show us how to use the Slack API in Python. To do this, we will create a Python application that will send daily information to the Slack channel that we want. This is going to be the final behavior.
For this purpose, we will divide the tutorial into the following points:
- Creation of a Slack application
- Creation of a Slack channel and authorize the Slack app
- Integration with the Python Script using the Slack API
Let’s start wiht it! Also, remember that you can check my courses about AWS and SnowFlake at my profile:
Gonzalo Fernandez Plaza - Medium
Read writing from Gonzalo Fernandez Plaza on Medium. Computer Science Engineer & Tech Lead @ThePowerMBA 🖥️. Data…
CREATION OF A SLACK APPLICATION
1) Create the application
To do it, we have different options. We can go to the Slack API page and create one directly (scroll down a little bit on this page to see the option): https://api.slack.com/tutorials/tracks/getting-a-token
We select a workspace (the Slack account where we want to create the application) and confirm it.
2) Install the application in Slack
Once we have created the app from the Slack API, we can access it from the following URL: https://api.slack.com/apps.
Once we are in our application, we install it on our workspace.