松弛-webhooks-发送图像

时间:2020-07-24 17:33:26

标签: curl webhooks slack

亲爱的

我正在尝试编写curl命令以通过webhook发送消息以使其松弛。 卷曲应该发送图像,并且该图像位于我的本地服务器中。

反正有这样做吗?

这是我的代码:

curl -X POST --data-urlencode "payload={\"attachments\":[{\"color\": \"warning\",\"title\":\"Additional Info :\",\"text\":\"\\nLook to the image\",\"image\": \"/image.png\"}]}" https://hooks.slack.com/services/XXXXXXXXXXX

1 个答案:

答案 0 :(得分:0)

对于传入的Webhook,您只能发送image_url,这意味着您需要首先在某个地方在线获取该图像。

如果要“上传”图像并将其从本地服务器发送,则需要Slack Web API和files.upload方法。这需要更多步骤才能开始工作