Is it possible to post files to Slack through python?
Now, slack has restricted creating tokens for new users, so how can I (new to slack) send some files through slack using python.
import pandas as pd import numpy as np import requests import json web_hook_url = 'https://hooks.slack.com/services/......' # api.slack.com/custom-integrations/legacy-tokens. file_path = "Firefox_wallpaper.png" with open(file_path , "rb") as f: slack_msg = {'filename':'Firefox_wallpaper.png', 'token':'what should I write here', 'channels':'demotest'} requests.post(web_hook_url,params = slack_msg, files={'file':f}) # print(slack_msg)