Creating a Subscription (Any Type)

Create any valid type of subscription in Notifications to receive notifications.

  • 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 page, specifying the topic in the panel: Click Create Subscription, and then select a Subscription Topic.

    1. Open the navigation menu and click Developer Services. Under Application Integration, click Notifications.
    2. On the Topics page, select the compartment that contains the topic that you want.
    3. Click the name of the topic that you want to add the subscription to.
    4. On the Topic Details page, click Create Subscription.
    5. In the Create Subscription panel, select the type of subscription that you want to create, then enter values in the associated fields.
      • Email: Enter an email address.
      • Function: Select the compartment and application that contain the function that you want, and then select the function.

      • HTTPS (Custom URL): Enter the URL that you want to use as the endpoint. Endpoint format:

        https://<anyvalidURL>

        For prerequisites, see Before You Begin. Query parameters aren't permitted in URLs.

      • PagerDuty: Enter the integration key portion ( PagerDuty endpoint). The other portions of the URL are hard-coded. Full endpoint format:

        https://events.pagerduty.com/integration/<integrationkey>/enqueue

        Query parameters aren't permitted in URLs.

      • Slack: Enter the Slack endpoint, including the webhook token. Endpoint 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.

      • SMS: Select the country for the phone number, and then enter the phone number, using E.164 format. Example: +14255550100

      For more information about each subscription type, see "subscription" under Notifications Concepts.

    6. (Optional) Under Show advanced options, enter one or more tags for the subscription.
      If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later. For more information, see Tagging a Subscription at Creation.
    7. Click Create.
    Notifications creates the subscription. If the subscription type requires a confirmation, then Notifications sends a confirmation URL to its endpoint and the subscription is pending until confirmation is received.
  • Use the oci ons subscription create command and required parameters to create a subscription:

    oci ons subscription create --compartment-id <compartment_OCID> --protocol <subscription_type> --subscription-endpoint <endpoint> --topic-id <topic_OCID>

    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 subscription.

What's Next

Confirmation is required for some protocols, such as email. In this case, the new subscription remains in Pending (PENDING) status until confirmation is received. Notifications sends a confirmation URL to the subscription endpoint, such as an email address for an email subscription. To confirm a new subscription, or to review subscription protocols that require confirmation, see Confirming a Subscription.

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.