Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 513
Saifis Avatar asked Mar 02 '16 09:03

Saifis


People also ask

What can you do with a Slack webhook?

Message options Incoming webhooks allow you to add context to your messages by attaching helpful content and links. Things like images, websites, or other pieces of data make these messages more useful for your team.

Can we send files in Slack?

What types of files can I share in Slack? You can share just about any file type up to 1 GB in size in Slack from your device, or add them from a file management app such as Box, Dropbox, Google Drive or OneDrive.


1 Answers

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.

like image 57
Erik Kalkoken Avatar answered Sep 28 '22 19:09

Erik Kalkoken