Creating a Slack Subscription

Create a Slack subscription in Notifications.

Before You Begin

To create a Slack subscription, you must have a webhook token for the endpoint URL. See the Slack documentation.

  • These steps show how to open the Create Subscription panel from the details page for the topic that you want to add the subscription to. You can also open this panel from the Subscriptions list page, specifying the topic in the panel: Select Create Subscription, and then select a Subscription Topic.
    1. On the Topics list page, select the topic that you want to work with. If you need help finding the list page or the topic, see Listing Topics.
    2. On the topic's details page, select Create Subscription.
    3. In the Create Subscription panel, for Protocol, select Slack.
    4. Enter the Slack endpoint, including the webhook token, using the following format:
      https://hooks.slack.com/services/<webhook-token>

      The <webhook-token> portion of the URL contains two slashes (/). Query parameters aren't permitted in URLs.

    5. Select Create.

    Notifications creates the Slack subscription and sends a confirmation URL to its endpoint. The subscription is pending until confirmation is received.

  • Use the oci ons subscription create command and required parameters to create a Slack subscription:

    oci ons subscription create --protocol "SLACK" --subscription-endpoint <Slack_endpoint> [...]

    For a complete list of parameters and values for CLI commands, see the Command Line Reference for Notifications.

  • Run the CreateSubscription operation to create a Slack subscription.

    Example:

    POST /20181201/subscriptions
    Host: notification.us-phoenix-1.oraclecloud.com
    <authorization and other headers>
    {
      "topicId": "<topic_OCID>",
      "compartmentId": "<compartment_OCID>",
      "protocol": "SLACK",
      "endpoint": "<slack-endpoint>"
    }

What's Next

To activate the new subscription, navigate to the confirmation URL that was sent to Slack.

Although a new subscription must be in the same compartment as its parent topic, you can move it to another compartment after creation. See Moving a Subscription.