是否可以使用传入的 Webhook 将文件发布到 Slack? [英] Is it possible to post files to Slack using the incoming Webhook?
问题描述
我正在使用传入的 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,但是当发布消息运行良好时,仅出于上传文件的目的创建更多令牌似乎很奇怪,是否无法上传文件以应对传入的文件微信?
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
标签将图片网址附加到您的附件中.
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屋!