如何允许通过curl上传的松弛帖子可以被其他人编辑 [英] How to allow a slack post uploaded via curl to be editable by others

查看:67
本文介绍了如何允许通过curl上传的松弛帖子可以被其他人编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下curl请求上传文件:

I am using this curl request to upload a file:

curl -s -F文件= @%s -F频道=% s -F initial_comment =%s -F token =%s https://slack.com/api/files.upload'

想法是通过管道将文件上传到备用频道,然后让其他人来编辑该文件。我似乎找不到用于允许通过此方法上传的文件供其他人编辑的标志

The idea is to have the file uploaded to a slack channel by a pipeline and have someone else edit the file. I can't seem to find the flag to allow a file uploaded by this method to be available for edit by others

推荐答案

I对 files.upload 进行了一些研究,我的结果是,无法以使其他用户可编辑的方式上传文件。

I did some research on files.upload and my result is that it is not possible to upload a file in a way that would make it editable by other users.

如果您以纯文本格式上载文件(例如 filetype = plain ),则该文件将变为可编辑状态,但只有上载文件的用户才能编辑文件,例如令牌所有者。该API没有提供使其可被其他用户编辑的选项。

If you upload a file as plain text (e.g. filetype = plain) the file becomes editable, but only by the user who uploaded the file, e.g the token owner. The API does not provide an option to make it editable by other users.

如果您将文件上传为帖子(例如 filetype = post )文件的所有者以后可以使任何人都可以编辑该帖子,但只能手动进行。同样,没有选择通过API来执行此操作。

If you upload a file as post (e.g. filetype = post) the owner of the file can later make that post editable by anyone, but only manually. Again, there is no option to do that by the API.

我能想到的唯一解决方案是创建一个Slack应用程序来管理文件的上载和编辑。例如您可能会有一个带有 textarea 元素以编辑文件的内容。 Textarea 元素最多可容纳3.000个字符。

The only solution to your issue I can think of is creating a Slack app that manages file uploads and editing. e.g. you could have a Dialog with a textarea element to edit the content of a file. Textarea elements can hold up to 3.000 chars.

请注意,对于该应用程序,您可能希望将文件存储在外部可以编辑Slack,因为Slack不允许您在文件上传后对其进行编辑。 (至少没有官方API,但有非正式的 files.edit 方法,但只能在特殊情况下使用。)

Note that for that app you probably want to store your files outside of Slack while it can be edited, because Slack does not allow you to edit a file after it has been uploaded. (At least not with the official API, there is the unofficial files.edit method, but this can only be used in special cases).

这篇关于如何允许通过curl上传的松弛帖子可以被其他人编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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