A webhook receives data from an external system when an event happens and automatically sends this information to you. Semantik Invoice uses webhooks to provide real-time updates with other applications.
With this guide, you can set up custom notifications in your Slack channels when invoices are successfully processed in Semantik Invoice.
Instructions
Follow these steps to set up Semantik Invoice webhooks with Slack:
Semantik Invoice Steps
Go to Settings > Export Setup.
Click Add Integration.
Select Webhook as your integration method.
For the Integration Name, enter the name of your webhook. For example, enter “Slack.”
Slack Steps
For the Destination URL, navigate to Slack API: Applications to create the webhook URL where the notifications will be sent. Click Create an App.
Enter an App Name. This will be the name that provides the live updates from Semantik Invoice in your Slack channel.
Click Create App. You will be redirected to the Settings screen for your app (figure 7).
Click Incoming Webhooks.
Turn on the Activate Incoming Webhooks toggle.
Click Add New Webhook to Workspace. The following screen displays.
Select a channel in your workspace. This will be the location where notifications are sent.
Click Allow to generate the webhook URL. An example is shown below.
Copy the webhook URL.
Semantik Invoice Steps
Navigate back to the Webhook screen in Semantik Invoice (Settings > Export Setup > Add Integration).
Paste the webhook URL from step 14 in the Destination URL field.
Note: The Content Type is application/json by default.For the Custom Payload field, use the Slack Message Builder to format and preview the JSON payload that displays your Semantik Invoice notifications in Slack. An example is provided below.
Note: For custom JSON payloads, ensure the variables are enclosed in double quotation marks (” “).
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Another invoice has been processed :tada:"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Invoice Number*: $InvoiceNumber"
},
{ "type": "mrkdwn",
"text": "*TotalAmount*: $$TotalAmount"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "<$PdfUrl | Download PDF>"
}
}
]
}
Click Test to test and establish the connection.
Note: If your connection returns an error message, ensure the values in the required fields are accurate.Click Save to create the webhook. The Export Setup screen displays.
Turn on the toggle for the webhook you created to activate the integration.
The JSON payload returns the following message formatting in Slack as an example:
Figure 1. Slack Notification Example
You have successfully configured your webhook with Slack! You will receive a notification in your selected channel when an invoice has been reviewed and validated.