Is it possible to post files to Slack using the incoming Webhook?

ApiSlack ApiSlack

Api Problem Overview


I am trying out the Slack's API using the incoming webhook feature, posting messages works flawlessly, but it doesn't seem to allow any file attachments.

Looking through I understand I have to use a completely different OAuth based API, but creating more tokens just for the purpose of uploading a file seems odd when posting messages works well, is there no way to upload files to slack with the incoming webook?

Api Solutions


Solution 1 - Api

No, its is not possible to upload files through an incoming Webhook. But you can attach image URLs to your attachments with the image_url tag.

To upload files you need to use the Slack Web API and the files.upload method. Yes, it requires a different authentication, but its not that complicated if you just use a test token for all API calls.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSaifisView Question on Stackoverflow
Solution 1 - ApiErik KalkokenView Answer on Stackoverflow