1. Home
  2. Semantik Invoice
  3. Exporting Data
  4. Integrating Webhooks with Slack

Integrating Webhooks with Slack

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

  1. Go to Settings > Export Setup.

Figure 1. Export Setup

  1. Click Add Integration.

Figure 2. Add Integration Button

  1. Select Webhook as your integration method.

Figure 3. Select Webhook Integration

  1. For the Integration Name, enter the name of your webhook. For example, enter “Slack.”

Slack Steps

  1. For the Destination URL, navigate to Slack API: Applications to create the webhook URL where the notifications will be sent. Click Create an App.

 

Figure 4. Create an App Button

The following dialog box will display:

Figure 5. Create a Slack App

  1. Enter an App Name. This will be the name that provides the live updates from Semantik Invoice in your Slack channel.
  2. Select your Development Slack Workspace. An example is provided below.

Figure 6. Select a Development Slack Workspace

  1. Click Create App. You will be redirected to the Settings screen for your app (figure 7).
  2. Click Incoming Webhooks.

Figure 7. Incoming Webhooks

  1. Turn on the Activate Incoming Webhooks toggle.

Figure 8. Activate Webhook

  1. Click Add New Webhook to Workspace.

Figure 9. Add New Webhook

The following screen displays.

Figure 10. Select the Slack Channel

  1. Select a channel in your workspace. This will be the location where notifications are sent.
  2. Click Allow to generate the webhook URL. An example is shown below.

Figure 11. Copy the Webhook URL

  1. Copy the webhook URL.

Semantik Invoice Steps

  1. Navigate back to the Webhook screen in Semantik Invoice (Settings > Export Setup > Add Integration).
  2. Paste the webhook URL from step 14 in the Destination URL field.

Note: The Content Type is application/json by default.

  1. 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>"
            }
        }
    ]
}

This JSON payload returns the following message formatting in Slack:

Figure 12. Notification Example

  1. 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.

  1. Click Save to create the webhook. The Export Setup screen displays.

Figure 13. Successful Webhook Configuration

  1. Turn on the toggle for the webhook you created to activate the integration.

Figure 14. Successful Webhook Configuration

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.

 

Was this article helpful to you? Yes No