Integration with slack can be used to send alerts to users and channels to notify when certain events are triggered.
Configuration config.json was created using AutoFlow version 0.2.5
Is you have questions about this example, feel free to post your question on the community "<a href=https://www.interactor.com/support/forum" target="_blank">Ask Questions" website.
- Create an HTTP Server
- Create an endpoint
- NOTE: under properties the method must be POST
- From the right panel, press Action tab -> communication, Drag and drop HTTP-Request to the end of the flow
- From the right panel, press Action tab -> data, Drag and drop Set to the end of the flow
Slack takes in HTTP request body as below
{
"text": "Message content"
}
Use Data/Set action to create the object.
- url: NOTE: Paste the slack webhook
- Method: POST
- Body: Contents of what is being posted to slack. NOTE: May need to specify the content type as application json. { “Content-Type”: “Application/JSON” }
- Header: blank
- Query: blank
- Timeout: Default
Select Method Post and Paste your slack http server. NOTE: Yours may differ
In the HTTP Request Header, insert the message you want to send. For example
Hello World!
For Additional help on sending messages Slack webhooks: https://api.slack.com/messaging/webhooks
- Navigate to api.slack.com
- Once logged in click on Your Apps on the right end of the navigation bar
- Select Create New App
- Create the application name and select which workspace this app will belong too
- Select basic information underneath the settings. Select add features and functionality. From here you can add additional functionality but for this example we just are using incoming webhooks.
- After selecting and activating incoming webhooks. Scroll to the bottom and select add new webhook to workspace. Select which channel to post to and allow.
- Copy JUST the URL from the sample. NOTE: Your webhook will be unique
- Paste the slack webhook on the url line under properties from the communication/http-request action