我已将 Twitter 和 Google Drive 应用程序添加到我的 Slack 团队。对于我目前正在开发的 ERP 系统,我想替换某些 URL,类似于 Twitter / Google Drive 的做法:
显而易见的方法似乎是使用带有 URL 第一部分的传出 Webhook(例如https://erp.acme.com)作为“触发词”,但这似乎不适用于私人组和频道。Google Drive 似乎没有这个限制。哪个 API 提供了足够的灵活性?
我已将 Twitter 和 Google Drive 应用程序添加到我的 Slack 团队。对于我目前正在开发的 ERP 系统,我想替换某些 URL,类似于 Twitter / Google Drive 的做法:
显而易见的方法似乎是使用带有 URL 第一部分的传出 Webhook(例如https://erp.acme.com)作为“触发词”,但这似乎不适用于私人组和频道。Google Drive 似乎没有这个限制。哪个 API 提供了足够的灵活性?
An engineer from Slack replied and offered two solutions. Thanks Brad!
Solution A
Set the outgoing webhook trigger to <https://erp.acme.com
– note the opening <
, as that's how URLs are parsed on Slack's side. The outgoing webhooks currently only work in public channels.
Solution B
Provide meta tags to make use of Slack's "unfurling".
You can read the link expanding documentation here, as well as this in-depth blog post about Slack unfurling.