Image element
Example:
Fields
Field | Type | Description | Required? |
---|---|---|---|
type | String | The type of element. In this case type is always image . | Required |
alt_text | String | A plain-text summary of the image. This should not contain any markup. | Required |
image_url | String | The URL for a publicly hosted image. You must provide either an image_url or slack_file . Maximum length for this field is 3000 characters. | Optional |
slack_file | Object | A Slack image file object that defines the source of the image. | Optional |
Usage info
Use the image
block if you want a block with only an image in it.
Example
{
"type": "image",
"image_url": "http://placekitten.com/700/500",
"alt_text": "Multiple cute kittens"
}
An image block using slack_file
with a url
:
{
"type": "image",
"slack_file": {
"url": "https://files.slack.com/files-pri/T0123456-F0123456/xyz.png"
},
"alt_text": "Slack file object."
}
An image block using slack_file
with a id
:
{
"type": "image",
"slack_file": {
"id": "F0123456",
},
"alt_text": "Slack file object."
}