如何使用 slack API get/enable public URL 上传到 slack 的媒体
How to get/enable public URL for media uploaded to slack using slack API
我正在使用 slack api 将媒体上传到 public 频道,作为响应,我得到了上传媒体的不同 url,包括 'permalink_pulic',这似乎是public URL,但是 link 没有 work.Other 链接只能由闲散的团队成员访问。
我们有什么方法可以启用这些 public_link,以便可以在 slack 之外访问媒体。
通常 Slack 文件不是 public,但如果需要,您可以打开 public 访问它们。
上传后调用方法 files.sharedPublicURL
以启用 public 通过其 permalink_public
URL.
访问 Slack 文件
有关详细信息,请参阅 API documentation。
要启用 public link,您的应用需要来自团队的 file:write:user 权限范围,团队的 access_token
以及您要制作的具体 file_id
public
然后向 Slack 的 files.sharedPublicURL(access_token, file_id)
端点发送请求以接收包含文件 ID 的 JSON 对象。
您可以使用新的 Slack Events API to have Slack send your app file information, including the file id, when events as file_created or file_shared occur. Here's a list of events Slack supports
我正在使用 slack api 将媒体上传到 public 频道,作为响应,我得到了上传媒体的不同 url,包括 'permalink_pulic',这似乎是public URL,但是 link 没有 work.Other 链接只能由闲散的团队成员访问。
我们有什么方法可以启用这些 public_link,以便可以在 slack 之外访问媒体。
通常 Slack 文件不是 public,但如果需要,您可以打开 public 访问它们。
上传后调用方法 files.sharedPublicURL
以启用 public 通过其 permalink_public
URL.
有关详细信息,请参阅 API documentation。
要启用 public link,您的应用需要来自团队的 file:write:user 权限范围,团队的 access_token
以及您要制作的具体 file_id
public
然后向 Slack 的 files.sharedPublicURL(access_token, file_id)
端点发送请求以接收包含文件 ID 的 JSON 对象。
您可以使用新的 Slack Events API to have Slack send your app file information, including the file id, when events as file_created or file_shared occur. Here's a list of events Slack supports