Slack Outbound Webhooks

Create an outgoing webhook in Apono that will send messages in a Slack channel based on an Apono access requests

Overview

The steps below describe how to create an outgoing webhook in Apono that will allow to automatically send messages in Slack from Apono access requests.

Step-by-step guide

Prerequisites

  1. Create a Slack app or use an existing one
  2. Enable incoming webhooks From your Slack app's management dashboard. Select Incoming Webhooks, and toggle Activate Incoming Webhooks to on.
  3. Create an incoming webhook - Now that incoming webhooks are enabled, the settings page should refresh and a button called Add New Webhook to Workspace will appear.
    1. Pick a channel that the app will post to, then select Authorize. If you need to add the incoming webhook to a private channel, you must be a member of that channel.
    2. You'll be sent back to your app settings, where you should see a new entry under the Webhook URLs for Your Workspace section. Your webhook URL will look something like this: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Creating the webhook

  1. In the Apono admin portal, click your avatar at the bottom left corner, click Settings and pick Webhooks
  1. Click Add Webhook
  2. Fill in the following fields:
  3. Method - POST
  4. URL
    https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
    
    Replace with your webhook URL
  5. The webhook body:
{
  "text": "New {{ event_type }} from {{ data.requester.name }}",
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "New {{ event_type }} ",
				"emoji": true
			}
		},
		{
			"type": "section",
			"fields": [
				{
					"type": "mrkdwn",
					"text": "*Type:*\nPaid Time Off"
				},
				{
					"type": "mrkdwn",
					"text": "*Created by:*\n<{{ data.requester.email }}|{{ event_type }}>"
				}
			]
		},
		{
			"type": "section",
			"fields": [
				{
					"type": "mrkdwn",
					"text": "*When:*\n{{ event_time }}"
				}
			]
		}
	]
}

This is an example body. You may use other fields according to your needs. See the schema to the right of the screen to learn more about available data fields.

  1. Triggers - you may pick one or more triggers. Triggers correspond to Apono access request statuses:
  • Created
  • Approved
  • Rejected
  • Granted
  • Expired
  • Failed
  1. Name - any name of your choosing. This will be displayed in the webhooks table.
  2. Status - if you save the webhook as active, it can be triggered immediately. If you prefer, you may also save it as inactive and activate it later.
  3. Optional: Test your webhook configuration. You should see ok as the response status.
    Please note: The Test will send a message to your Slack channel with mock data.

Results

Your webhook should now start sending messages in the webhook Slack channel once triggered: