PostSlack

Description:

Sends a message on Slack. The FlowFile content (e.g. an image) can be uploaded and attached to the message.

Additional Details...

Tags:

slack, post, notify, upload, message

Properties:

In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Post Message URLpost-message-urlhttps://slack.com/api/chat.postMessageSlack Web API URL for posting text messages to channels. It only needs to be changed if Slack changes its API URL.
File Upload URLfile-upload-urlhttps://slack.com/api/files.uploadSlack Web API URL for uploading files to channels. It only needs to be changed if Slack changes its API URL.
Access Tokenaccess-tokenOAuth Access Token used for authenticating/authorizing the Slack request sent by NiFi.
Sensitive Property: true
ChannelchannelSlack channel, private group, or IM channel to send the message to.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
TexttextText of the Slack message to send. Only required if no attachment has been specified and 'Upload File' has been set to 'No'.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
Upload FlowFileupload-flowfileNo
  • Yes Upload and attach FlowFile content to the Slack message.
  • No Don't upload and attach FlowFile content to the Slack message.
Whether or not to upload and attach the FlowFile content to the Slack message.
File Titlefile-titleTitle of the file displayed in the Slack message. The property value will only be used if 'Upload FlowFile' has been set to 'Yes'.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
File Namefile-name${filename}Name of the file to be uploaded. The property value will only be used if 'Upload FlowFile' has been set to 'Yes'. If the property evaluated to null or empty string, then the file name will be set to 'file' in the Slack message.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)
File Mime Typefile-mime-type${mime.type}Mime type of the file to be uploaded. The property value will only be used if 'Upload FlowFile' has been set to 'Yes'. If the property evaluated to null or empty string, then the mime type will be set to 'application/octet-stream' in the Slack message.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Dynamic Properties:

Supports Sensitive Dynamic Properties: No

Dynamic Properties allow the user to specify both the name and value of a property.

NameValueDescription
<Arbitrary name>JSON snippet specifying a Slack message "attachment"The property value will be converted to JSON and will be added to the array of attachments in the JSON payload being sent to Slack. The property name will not be used by the processor.
Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)

Relationships:

NameDescription
successFlowFiles are routed to success after being successfully sent to Slack
failureFlowFiles are routed to failure if unable to be sent to Slack

Reads Attributes:

None specified.

Writes Attributes:

NameDescription
slack.file.urlThe Slack URL of the uploaded file. It will be added if 'Upload FlowFile' has been set to 'Yes'.

State management:

This component does not store state.

Restricted:

This component is not restricted.

Input requirement:

This component requires an incoming relationship.

System Resource Considerations:

None specified.