是否可以使用传入的Webhook将文件发布到Slack? [英] Is it possible to post files to Slack using the incoming Webhook?

查看:158
本文介绍了是否可以使用传入的Webhook将文件发布到Slack?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用传入的Webhook功能试用Slack的API,发布消息的过程很完美,但是似乎不允许任何文件附件.

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.

我了解到我必须使用完全不同的基于OAuth的API,但是在发布消息时效果很好,只是为了上传文件而创建更多令牌似乎很奇怪,无法将文件上传到接收方时变得松弛webook?

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?

推荐答案

否,无法通过传入的Webhook上传文件.但是您可以使用image_url标签将图像URL附加到附件中.

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.

要上传文件,您需要使用Slack Web API和 files.upload 方法.是的,它要求使用不同的身份验证,但是如果您只对全部使用测试令牌,它就不会那么复杂API调用.

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.

这篇关于是否可以使用传入的Webhook将文件发布到Slack?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆