Integrate with Slack
Send customized Slack messages directly from a Next Matter workflow to dedicated channels.
Before you begin
Check out our ready-made templates available when you add a step and select Templates > 3rd party templates. You can use the templates to create a set of pre-configured steps. Need a specific template? Click the Contact us button in the top right of the page and let us know.
Create a Next Matter Bot in your Slack workspace
The bot should be authorized to send messages on behalf of Next Matter.
- Go to https://api.slack.com/apps?new_app=1. You might have to log in.
- Click Create an App and choose From scratch.
- Enter the app’s name. It might be “Next Matter Bot”.
- Select your workspace from the dropdown.
- Click Create App.
- In the Display Information section you can set the App’s logo. Use the Next Matter logo for the bot.
- In the Add features and functionality section, click Bots.
- Click Review Scopes to Add.
- Scroll down to Scopes. In the Bot Token Scopes, click Add and OAuth Scope.
- Add scopes one by one by selecting them from the dropdown. You need the following scopes:
- “channels:read”
- “channels:join”
- “chat:write”
- “chat:write.public”
- “users:read.email”
- Scroll up to OAuth Tokens for Your Workspace and click Install to Workspace.
- Click Allow.
- Copy and save the displayed token.
Get the channel ID
If you don’t have channels yet, create one in Slack.
- Go to https://api.slack.com/methods/conversations.list/test.
- In the Arguments section, paste the token in the Or, provide your own token field.
- Click Test Method.
- In the API response section, search for the name of the channel to place the bot. The ID of the channel will be in the line above the name. For example:
Add bot to channel
- Open your Slack app and select the channel to post messages.
- Click the gear icon in the top right corner of the channel.
- Click Add an App.
- Type “Next Matter” in the search bar.
- Click Add.
You should see a message in the channel that the bot has been added.
Configure the notification step in a process
-
In your Next Matter portal, click Workflows, and then click the workflow you want to send messages to Slack.
-
Click Edit workflow.
-
Click +Add step and select Integration > Custom integration.
-
Click Settings to configure the step.
-
Enter the following details:
- Method: POST
- URL:
- Headers: Content-Type: application/json
- Headers: Authorization:
Bearer BOT_TOKEN
. Your entered details might look like the following:Bearer xoxb-364112219665-5014650446325-Pt0U8RutXz1FEwVLQpkj54lf
- In the Body enter the values. For example, the body might look like the following.
-
Save your changes.
Send a message to a user
As part of the workflow, you might want to send a Slack message to a specific user. The message will come from the customer’s Slack Next Matter App (see Create a Next Matter bot).
To send the message, you’ll need an integration step to get the Slack user ID and a step to send the message to the owner of this ID.
You’ll need a Slack token to authorize your calls. For more on getting the token, see Slack documentation. The API token might look like the following: xoxb-364112219665-5014650446325-Pt0U8RutXz1FEwVLQpkj54lf
.
-
Click +Add step and select Integration > Custom integration.
-
Click Settings to configure the step.
-
Enter the following details:
- Method: GET
- URL:
- Headers: Authorization:
Bearer BOT_TOKEN
. Your entered details might look like the following:Bearer xoxb-364112219665-5014650446325-Pt0U8RutXz1FEwVLQpkj54lf
- Body type: Form data
-
Create a variable for the user ID with the value of
$.user.id
. -
Save your changes.
-
Now create a step to send the message. Again, click +Add step and select Integration > Custom integration.
-
Click Settings to configure the step.
-
Enter the following details:
-
Method: POST
-
URL:
-
Headers: Content-Type: application/json; charset=utf-8
-
Headers: Authorization:
Bearer BOT_TOKEN
. Your entered details might look like the following:Bearer xoxb-364112219665-5014650446325-Pt0U8RutXz1FEwVLQpkj54lf
-
In the Body enter the values. For example, the body might look like the following. To get the channel ID, see Get the Slack channel ID.
- Save your changes.
-
Create a channel and invite users
You’ll need a Slack token to authorize your calls. For more on getting the token, see Slack documentation. The API token might look like the following: xoxb-364112219665-5014650446325-Pt0U8RutXz1FEwVLQpkj54lf
.
- Click +Add step and select Integration > Custom integration.
- Click Settings to configure the step.
- Enter the following details:
-
Method: POST
-
URL:
-
Headers: Authorization:
Bearer BOT_TOKEN
. Your entered details might look like the following:Bearer xoxb-364112219665-5014650446325-Pt0U8RutXz1FEwVLQpkj54lf
-
Content type: application/json; charset=utf-8
-
Body:
-
- Create a variable for the channel ID with the value of
$.channel.id
. - Save your changes.
- To invite users to your channel, click +Add step and select Integration > Custom integration.
- Click Settings to configure the step.
- Enter the following details:
-
Method: POST
-
URL:
-
Headers: Authorization:
Bearer BOT_TOKEN
. Your entered details might look like the following:Bearer xoxb-364112219665-5014650446325-Pt0U8RutXz1FEwVLQpkj54lf
-
Content type: application/json; charset=utf-8
-
Body:
-
- Create a variable for the channel ID with the value of
$.channel.id
. - Save your changes.
Send a reminder
Before you begin
- You’ll need to enter your Slack Team ID in the body of the send reminder call. To get the ID:
- Open any web browser and log in to your Slack account.
- Go to your workspace main page and check the URL in the search bar at the top.
- Copy the Team ID from the URL
- You’ll need a Slack token to authorize your calls. For more on how to get the token, see Slack documentation.
Set up reminder
- Click +Add step and select Integration > Custom integration.
- Click Settings to configure the step.
- Enter the following details:
-
Method: POST
-
URL:
URL:
-
Headers: Content-Type: application/json; charset=utf-8
-
Headers: Authorization: Slack_API_Key
-
Body:
-
- Create a variable for the Slack reminder ID with the value of $reminder.id.
- Save your changes.
Stop the reminder
- Click + Add step and select Integration > Custom integration.
- Click Settings to configure the step.
- Enter the following details:
-
Method: POST
-
Headers: Content-Type: application/json; charset=utf-8
-
Headers: Authorization: Slack_API_Key
-
Body:
-
- Create a variable for the Slack reminder ID with the value of $reminder.id.
- Save your changes.