SlackWebhook
Last updated
Last updated
type
Namespace
SlackWebhook.Enums
Summary
Action type
constants
Summary
Turns the button red and indicates it some kind of destructive action
constants
Summary
Turns the button green and indicates the best forward action to take
type
Namespace
SlackWebhook.Core
Summary
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook.Core
Summary
Handles escaping characters which the Slack webhook expects to be HTML encoded.
type
Namespace
SlackWebhook.Core
Summary
Cloneable type
Generic Types
Name
Description
T
Type of clone
method
Summary
Creates new clone of this instance
Returns
Cloned instance
Parameters
This method has no parameters.
type
Namespace
SlackWebhook.Enums
Summary
Icon type
constants
Summary
Icon is a slack emoji name, e.g.
constants
Summary
Icon is a image URL
type
Namespace
SlackWebhook
Summary
method
Summary
With author name, and optional link url and icon url
Parameters
Name
Type
Description
name
Author name (required)
linkUrl
Author link url (optional)
iconUrl
Author icon url (optional)
Remarks
The author parameters will display a small section at the top of a message attachment.
method
Summary
With hex-based color
Parameters
Name
Type
Description
hexColor
Hex color or one of named colors (good, warning, danger)
Remarks
Like traffic signals, color-coding messages can quickly communicate intent and help separate them from the flow of other messages in the timeline.
An optional value that can either be one of good, warning, danger, or any hex color code(eg. #439FE0). This value is used to color the border along the left side of the message attachment.
method
Summary
Parameters
Name
Type
Description
color
Color instance to set color from
method
Summary
With required plain-text summary of the attachment
Returns
Parameters
Name
Type
Description
fallback
Remarks
A plain-text summary of the attachment. This text will be used in clients that don't show formatted text (eg. IRC, mobile notifications) and should not contain any markup.
method
Summary
With attachment field shown as a table inside the message attachment
Parameters
Name
Type
Description
title
Title of field
Remarks
If enableFormatting
is enabled, you can use Slack message formatting in value
and it will automatically be encoded according to slack encoding rules.
method
Summary
With footer text and optional footer icon
Returns
Parameters
Name
Type
Description
text
iconUrl
Remarks
Add some brief text to help contextualize and identify an attachment. Limited to 300 characters, and may be truncated further when displayed to users in environments with limited screen real estate.
To render a small icon beside your footer text, provide a publicly accessible URL string in the footer_icon field. You must also provide a footer for the field to be recognized.
We'll render what you provide at 16px by 16px. It's best to use an image that is similarly sized.
method
Summary
With image url
Parameters
Name
Type
Description
url
Image url
Remarks
A valid URL to an image file that will be displayed inside a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.
Large images will be resized to a maximum width of 400px or a maximum height of 500px, while still maintaining the original aspect ratio.
method
Summary
With link on attachment title
Parameters
Name
Type
Description
url
Remarks
Link of title (optional)
method
Summary
With link button action, shown at the bottom of the attachment
Parameters
Name
Type
Description
text
Test shown on link button
url
URL opened if link button is pressed
style
Optional style
Remarks
An attachment may contain multiple actions
method
Summary
With optional pre-text
Parameters
Name
Type
Description
text
Pre-text
enableFormatting
Whether or not to enable formatting for text
Remarks
This is optional text that appears above the message attachment block.
method
Summary
With optional text
Parameters
Name
Type
Description
text
Text
enableFormatting
Whether or not to enable formatting for text
Remarks
This is the main text in a message attachment, and can contain standard message markup. The content will automatically collapse if it contains 700+ characters or 5+ linebreaks, and will display a "Show more..." link to expand the content. Links posted in the text field will not unfurl.
If enableFormatting
is enabled, you can use Slack message formatting in text
and it will automatically be encoded according to slack encoding rules.
method
Summary
With thumbnail url
Parameters
Name
Type
Description
url
Thumbnail url
Remarks
A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.
The thumbnail's longest dimension will be scaled down to 75px while maintaining the aspect ratio of the image. The filesize of the image must also be less than 500 KB.
For best results, please use images that are already 75px by 75px.
method
Summary
With timestamp based on timestamp
Parameters
Name
Type
Description
timestamp
DateTimeOffset to set timestamp from
Remarks
Does your attachment relate to something happening at a specific time?
By providing the ts field with an integer value in "epoch time", the attachment will display an additional timestamp value as part of the attachment's footer.
Use ts when referencing articles or happenings.Your message will have its own timestamp when published.
Example: Providing 123456789 would result in a rendered timestamp of Nov 29th, 1973.
method
Summary
With epoc timestamp
Parameters
Name
Type
Description
epochTime
Epoch timestamp
Remarks
Does your attachment relate to something happening at a specific time?
By providing the ts field with an integer value in "epoch time", the attachment will display an additional timestamp value as part of the attachment's footer.
Use ts when referencing articles or happenings.Your message will have its own timestamp when published.
Example: Providing 123456789 would result in a rendered timestamp of Nov 29th, 1973.
method
Summary
With required title
Parameters
Name
Type
Description
title
Title
Remarks
type
Namespace
SlackWebhook
Summary
Slack client
method
Summary
Parameters
Name
Type
Description
configureBuilder
Configure message to send using this builder
Exceptions
Name
Description
Thrown if validation of the message fails, such as if a required field is missing.
method
Summary
Parameters
Name
Type
Description
message
Slack message to send
Exceptions
Name
Description
Thrown if validation of the message fails, such as if a required field is missing.
type
Namespace
SlackWebhook
Summary
method
Summary
Returns
New message
Parameters
This method has no parameters.
Exceptions
Name
Description
Thrown if validation of the message fails, such as if a required field is missing.
method
Summary
With attachment build with provided attachment builder
Parameters
Name
Type
Description
configureAttachment
Attachment builder
Remarks
method
Summary
With channel
Parameters
Name
Type
Description
channel
The channel.
Remarks
method
Summary
With icon (url or emoji)
Parameters
Name
Type
Description
iconType
Type of icon
urlOrEmoji
URL or emoji name (depending on iconType
)
Remarks
method
Summary
With required message text
Parameters
Name
Type
Description
text
Message text
enableFormatting
Whether or not to enable formatting for text
Remarks
If enableFormatting
is enabled, you can use Slack message formatting in text
and it will automatically be encoded according to slack encoding rules.
method
Summary
With username
Parameters
Name
Type
Description
username
Username
Remarks
type
Namespace
SlackWebhook.Core
Summary
Object can be validated
method
Summary
Validates the current state of the object (including any nested validateable members)
Returns
True if the object is valid, false otherwise
Parameters
Name
Type
Description
validationErrors
Validation errors (if any found)
Remarks
Will find all (if any) validation errors and populate validationErrors
with each
type
Namespace
SlackWebhook.Messages
Summary
constants
Summary
constants
Summary
constants
Summary
property
Summary
Actions shown at the bottom of the message (optional)
property
Summary
Author icon URL (optional)
Remarks
property
Summary
Author link (optional)
Remarks
property
Summary
Author name (optional)
Remarks
The author parameters will display a small section at the top of a message attachment
property
Summary
Gets or sets the color.
Remarks
Like traffic signals, color-coding messages can quickly communicate intent and help separate them from the flow of other messages in the timeline.
An optional value that can either be one of good, warning, danger, or any hex color code(eg. #439FE0). This value is used to color the border along the left side of the message attachment.
property
Summary
property
Summary
Required plain-text summary of the attachment
Remarks
A plain-text summary of the attachment. This text will be used in clients that don't show formatted text (eg. IRC, mobile notifications) and should not contain any markup.
property
Summary
Fields shown as a table inside the message attachment (optional)
property
Summary
Footer text shown at the bottom of attachment (optional)
Remarks
Add some brief text to help contextualize and identify an attachment. Limited to 300 characters, and may be truncated further when displayed to users in environments with limited screen real estate.
property
Summary
Icon shown left of footer text (optional)
Remarks
To render a small icon beside your footer text, provide a publicly accessible URL string in the footer_icon field. You must also provide a footer for the field to be recognized.
We'll render what you provide at 16px by 16px. It's best to use an image that is similarly sized.
property
Summary
Image url (optional)
Remarks
A valid URL to an image file that will be displayed inside a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.
Large images will be resized to a maximum width of 400px or a maximum height of 500px, while still maintaining the original aspect ratio.
property
Summary
Optional text that appears above the attachment block
Remarks
This is optional text that appears above the message attachment block.
property
Summary
Optional text that appears within the attachment
Remarks
This is the main text in a message attachment, and can contain standard message markup. The content will automatically collapse if it contains 700+ characters or 5+ linebreaks, and will display a "Show more..." link to expand the content. Links posted in the text field will not unfurl.
property
Summary
Thumbnail url (optional)
Remarks
A valid URL to an image file that will be displayed as a thumbnail on the right side of a message attachment. We currently support the following formats: GIF, JPEG, PNG, and BMP.
The thumbnail's longest dimension will be scaled down to 75px while maintaining the aspect ratio of the image. The filesize of the image must also be less than 500 KB.
For best results, please use images that are already 75px by 75px.
property
Summary
Timestamp (epoch time) shown below attachment (optional)
Remarks
Does your attachment relate to something happening at a specific time?
By providing the ts field with an integer value in "epoch time", the attachment will display an additional timestamp value as part of the attachment's footer.
Use ts when referencing articles or happenings.Your message will have its own timestamp when published.
Example: Providing 123456789 would result in a rendered timestamp of Nov 29th, 1973.
property
Summary
Title of attachment (required)
Remarks
property
Summary
Link of title (optional)
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Parameters
Name
Type
Description
color
Color to set color hex from
method
Summary
Parameters
Name
Type
Description
timestamp
Timestamp to set epohc time from
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook.Messages
Summary
constructor
Summary
Initialize attachment action
Parameters
Name
Type
Description
type
Type of action
property
Summary
Text displayed for the action
Remarks
How this is presented depends on the type of action
property
Summary
Type of action
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook
method
Summary
Parameters
Name
Type
Description
formattingType
Formatting type
enable
Whether to enable (add) or disable (remove)
type
Namespace
SlackWebhook.Messages
Summary
property
Summary
Whether field can be shown side-by-side with other fields (optional)
property
Summary
Title of field
Remarks
Shown as a bold heading above the value text. It cannot contain markup and will be escaped for you.
property
Summary
Value of field (may contain formatting if enabled)
Remarks
The text value of the field. It may contain standard message markup and must be escaped as normal. May be multi-line.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook.Messages
Summary
constructor
Summary
Create new empty link button action
Parameters
This constructor has no parameters.
property
Summary
Optional style
property
Summary
URL to open if link button is clicked
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook
Summary
Inherit from parent.
constructor
Summary
Inherit from parent.
Parameters
This constructor has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook.Messages
Summary
Basis for a Slack message which can be sent to the webhook URL
property
Summary
Attachments to show below message (optional)
property
Summary
Channel the message is posted into (optional)
property
Summary
Whether or not to enable formatting for this message
Remarks
Default true
property
Summary
Icon emoji name () (optional)
Remarks
property
Summary
Icon URL to show before username (optional)
Remarks
property
Summary
Remarks
You can use the regular Slack formatting
and also include links
property
Summary
Username shown (optional)
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook
Summary
Inherit from parent.
constructor
Summary
Create new slack message builder
Parameters
This constructor has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
type
Namespace
SlackWebhook.Exceptions
Summary
Slack message validation exception
constructor
Summary
Create new validation exception
Parameters
Name
Type
Description
message
Exception message
validationErrors
Validation errors
property
Summary
Validations errors
type
Namespace
SlackWebhook.Exceptions
Summary
Validation error details
constructor
Summary
Create new validation error
Parameters
Name
Type
Description
typeName
Type where validation error occurred
propertyName
Property which failed validation
error
Validation error
property
Summary
Validation error
property
Summary
Property which failed validation
property
Summary
Type where validation error occurred
method
Summary
Inherit from parent.
Parameters
This method has no parameters.
json converter
See for more.
Slack attachment builder used to configure an attachment to be added to a
A valid URL that will hyperlink the text mentioned above. Will only work if is present.
A valid URL that displays a small 16x16px image to the left of the text. Will only work if is present.
With color from instance
Shown as a bold heading above the value text. It cannot contain markup and will be escaped for you. | | value | | Value of field (may contain formatting if enabled)
The text value of the field. It may contain standard message markup and must be escaped as normal. May be multi-line. | | isShort | | Whether field can be shown side-by-side with other fields (optional) | | enableFormatting | | Whether or not to enable formatting for value |
The title is displayed as larger, bold text near the top of a message attachment. By passing a valid URL in the parameter (optional), the title text will be
Send new by configuring the provided
Uses to perform validation. |
Send the provided
Uses to perform validation. |
Slack message builder that produces instances based on the builder's current configuration.
Build based on current state of the builder
Uses to perform validation. |
Adds a new to built using provided
Sets the property
Sets the or based on iconType
with the provided value urlOrEmoji
Sets the and properties.
Sets the property
Optional attachment to a .
See for more details
Used to enable formatting of the value fields
Used to enable formatting of the field
Used to enable formatting of the field
A valid URL that displays a small 16x16px image to the left of the text. Will only work if is present.
A valid URL that will hyperlink the text mentioned above. Will only work if is present.
Enable formatting for various fields of the attachment, use , and to contorl which fields have formatting enabled.
The title is displayed as larger, bold text near the top of a message attachment. By passing a valid URL in the parameter (optional), the title text will be hyperlinked.
Set color hex code from
Set epoch value based on provided date time
Optional action to se .
Enables or disables formatting by adding/removing formattingType
from
Optional attachment field added to
Button action which will open a , if clicked
Either provide this OR , but not both
Either provide this OR , but not both
Message text which may contain formatting (unless is deactivated) and can span multiple lines.
Checks the current state using and throws a with all validations errors, if any are found.