slackhq / slack-api-docs

API Docs for Slack.com
https://api.slack.com/
426 stars 85 forks source link

Attachments image_url doesn't show if alone #53

Open bbshih opened 8 years ago

bbshih commented 8 years ago

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

patrickml commented 7 years ago

+1

patrickml commented 7 years ago

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 commented 7 years ago

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

https://cl.ly/0I420a431y0z

mikeres0 commented 7 years ago

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

euqen commented 7 years ago

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

sarahbethfederman commented 6 years ago

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

stevebissett commented 4 years ago

Having this problem today too, was this fixed?

aindong commented 4 years ago

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