Slack Channel Provider

Configuration

To configure the Slack integration, you'll need the following data:

required fields are marked with an `*`
ParameterTypeDescription
client_idstring *The Slack client ID that can be found in the app's settings page of the Slack API dashboard.
client_secretstring *The Slack client secret that can be found in the app's settings page of the Slack API dashboard.
signing_secretstring *The Slack signing secret that can be found in the app's settings page of the Slack API dashboard.
app_idstring *The Slack app ID that can be found in the app's settings page of the Slack API dashboard.

In the Dashboard

The easiest way to configure this integration is through the MagicBell dashboard:

  1. Log in to your MagicBell dashboard.
  2. Navigate to Channels.
  3. Find and click on this channel name in the sidebar.
  4. Click the Configure Slack button.
  5. Follow the on-screen instructions to complete the configuration.

Using the API

Use the API to save , list and delete Slack. For example, to save the integration:

Request
curl --request PUT \
  --url 'https://api.magicbell.com/v2/integrations/slack' \
  --header 'content-type: application/json' \
  --header "authorization: Bearer $TOKEN" \
  --data '{"app_id":"12345678901","client_id":"1.0","client_secret":"12345678901234567890123456789012","signing_secret":"12345678901234567890123456789012"}'

Channel Token

The channel token contains all the information (along with the config) necessary to deliver the notification on the Slack channel.

required fields are marked with an `*`
ParameterTypeDescription
webhookobject Obtained directly from the incoming_webhook object in the installation response from the Slack API.
└ urlstring *The URL for the incoming webhook from Slack
oauthobject
└ scopestring The OAuth scope granted during installation
└ channel_idstring *The ID of the Slack channel this installation is associated with
└ installation_idstring *A unique identifier for this Slack workspace installation

Example

{
  "webhook": {
    "url": "https://example.com/webhook"
  }
}

Managing Tokens

Use the API to list , list , delete , delete , save , fetch , fetch , fetch , fetch , list , list , delete , delete and save Slack tokens. For example, to save a token:

Request
curl --request PUT \
  --url 'https://api.magicbell.com/v2/channels/slack/tokens' \
  --header 'content-type: application/json' \
  --header "authorization: Bearer $TOKEN" \
  --data '{"webhook":{"url":"https://example.com/webhook"}}'
Request
curl --request PUT \
  --url 'https://api.magicbell.com/v2/channels/slack/magicbell_slackbot/tokens' \
  --header 'content-type: application/json' \
  --header "authorization: Bearer $TOKEN" \
  --data '{"webhook":{"url":"https://example.com/webhook"}}'

Usage

1. When configured with

{
  "app_id": "12345678901",
  "client_id": "1.0",
  "client_secret": "12345678901234567890123456789012",
  "signing_secret": "12345678901234567890123456789012"
}

2. With a channel token

{
  "webhook": {
    "url": "https://example.com/webhook"
  }
}

3. With Broadcast

{
  "action_url": "https://example.com",
  "category": "example",
  "content": "I come from broadcast",
  "custom_attributes": {},
  "id": "d1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
  "overrides": {},
  "recipients": [
    {
      "custom_attributes": {
        "plan": "enterprise",
        "preferred_pronoun": "They",
        "pricing_version": "v10"
      },
      "email": "[email protected]",
      "external_id": "83d987a-83fd034",
      "first_name": "Person",
      "last_name": "Doe",
      "phone_numbers": [
        "+1 5005550001"
      ]
    }
  ],
  "title": "Hello, World!",
  "topic": "example"
}

The channel handler triggers a HTTP request

POST https://example.com/webhook

With payload

{
  "delete_original": false,
  "replace_original": false,
  "text": "*Hello, World!*\nI come from broadcast\nhttps://example.com"
}

Debugging

To debug the integration, you can use the following tools and techniques:

  • Use the Deliveries screen in the MagicBell dashboard to monitor notification deliveries and troubleshoot issues.
  • To experiment with or test the Slack API, you can use the Slack notification tester.