slack-api-docs icon indicating copy to clipboard operation
slack-api-docs copied to clipboard

Attachments image_url doesn't show if alone

Open bbshih opened this issue 8 years ago • 8 comments

Image doesn't show when using postMessage if the attachment doesn't include the fallback or any additional text message. Unsure if this is intended or just not documented.

Doesn't work: https://api.slack.com/docs/formatting/builder?msg=%7B%22attachments%22%3A%5B%7B%22image_url%22%3A%22http%3A%2F%2Fplacehold.it%2F350x150.jpg%22%2C%22color%22%3A%22%23764FA5%22%7D%5D%7D

Works: https://api.slack.com/docs/formatting/builder?msg=%7B%22attachments%22%3A%5B%7B%22title%22%3A%22Network%20traffic%20(kb%2Fs)%22%2C%22image_url%22%3A%22http%3A%2F%2Fplacehold.it%2F350x150.jpg%22%2C%22color%22%3A%22%23764FA5%22%7D%5D%7D

bbshih avatar May 02 '16 17:05 bbshih

+1

patrickml avatar Feb 04 '17 01:02 patrickml

i'm wondering if there is just an issue with the preview system. I just tried to copy the Datadog example and the image isn't showing up either

https://api.slack.com/docs/messages/builder?msg=%7B%22attachments%22%3A%5B%7B%22fallback%22%3A%22Network%20traffic%20(kb%2Fs)%3A%20How%20does%20this%20look%3F%20%40slack-ops%20-%20Sent%20by%20Julie%20Dodd%20-%20https%3A%2F%2Fdatadog.com%2Fpath%2Fto%2Fevent%22%2C%22title%22%3A%22Network%20traffic%20(kb%2Fs)%22%2C%22title_link%22%3A%22https%3A%2F%2Fdatadog.com%2Fpath%2Fto%2Fevent%22%2C%22text%22%3A%22How%20does%20this%20look%3F%20%40slack-ops%20-%20Sent%20by%20Julie%20Dodd%22%2C%22image_url%22%3A%22https%3A%2F%2Fdatadoghq.com%2Fsnapshot%2Fpath%2Fto%2Fsnapshot.png%22%2C%22color%22%3A%22%23764FA5%22%7D%5D%7D

{
    "attachments": [
        {
            "fallback": "Network traffic (kb/s): How does this look? @slack-ops - Sent by Julie Dodd - https://datadog.com/path/to/event",
            "title": "Network traffic (kb/s)",
            "title_link": "https://datadog.com/path/to/event",
            "text": "How does this look? @slack-ops - Sent by Julie Dodd",
            "image_url": "https://datadoghq.com/snapshot/path/to/snapshot.png",
            "color": "#764FA5"
        }
    ]
}

image

patrickml avatar Feb 04 '17 01:02 patrickml

It doesn't seem to be working in slack at all

https://cl.ly/0I420a431y0z

patrickml avatar Feb 04 '17 01:02 patrickml

+1 I cannot get this to work at all. Any updates on the progress?

mikeres0 avatar May 16 '17 16:05 mikeres0

+1 I'm not able to add image which is more then 400x500px.

euqen avatar Jun 14 '17 16:06 euqen

+1 also having this problem. Was there ever a resoluton?

sarahbethfederman avatar Mar 19 '18 20:03 sarahbethfederman

Having this problem today too, was this fixed?

stevebissett avatar Nov 19 '19 15:11 stevebissett

I experienced the same problem, using legacy attachment message, not working

aindong avatar Jan 21 '20 10:01 aindong