Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23390

slack files & url with headers

$
0
0

I'm building a slack bot (python/slack-bolt).Trying to share a private image within the app home tab.

The home tab is genereted using client.views_publish.

{"type": "image","title": {"type": "plain_text","text": "test image",             },"image_url": "https://files.slack.com/files-pri/<private_ref>/test.jpg","alt_text": "test"                    },

Now image_url isn't valid as this is a private file.But the file can be accessed via the requests with headers:e.g. this downloads the file correctly:

curl https://files.slack.com/files-pri/<private_ref>/test.jpg --header "Authorization: Bearer <bot_token>" --output test.jpg

How can the url for an image be constructed for the slack blocks so the private image is available to the bot homepage?


Viewing all articles
Browse latest Browse all 23390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>