Integrating Slack Using API Call Notifications

Last edit:  Jan 17, 2019

Contributors:  lemingos

This guide will help you create a Slack integration for platformOS using API Call Notifications.

Requirements

To follow this tutorial, you should be familiar with creating API call notifications. You also have to have access to a Slack workspace, have enabled webhooks, and created an incoming webhook. You will need the webhook URL for creating the API call notification.

Steps

Integrating Slack using API call notifications is a two-step process:

Step 1: Create API call notification

Your webhook URL looks similar to this: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX.
Create an API call notification using your own webhook URL (replace placeholder):

---
name: { name of your file here }
delay: 0
enabled: true
format: http
headers: '{ "Content-Type": "application/json" }'
request_type: POST
to: { your webhook URL, e.g. https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX }
trigger_condition: true
---
{
	"text": "New Contact on Platform.OS.com!"
}

Step 2: Add API call notification to form

Add the following to the front matter on your form:

api_call_notifications:
- { slack_sales_request }

The front matter of the form we used in this example:

---
name: enquirer_signup
resource: User
fields:
  email:
  password:
api_call_notifications:
  - slack_sales_request
---

Questions?

We are always happy to help with any questions you may have. Check out our Help page, or contact us.