Adding a Subscription
Scenarios
To enable an endpoint to receive messages published to a topic, you must subscribe the endpoint to the topic. The endpoint can be a phone number, email address, or an HTTP/HTTPS URL. After you subscribe an endpoint to a topic and the subscription is confirmed, the endpoint can receive messages published to the topic.
You can add multiple subscriptions to a topic. This section describes how to add a subscription to a topic you created or a topic that you have permissions for.
Adding a Subscription
- Log in to the management console.
- In the upper left corner of the page, click
and select the desired region and project.
- Select Simple Message Notification under Application.
The SMN console is displayed.
- In the navigation pane on the left, choose Topic Management > Subscriptions.
- In the upper right corner, click Add Subscription.
The Add Subscription dialog box is displayed.
Figure 1 Add Subscription - Specify the required subscription information.
- Beside Topic Name, click Select Topic.
- Specify the subscription protocol and endpoints.
Table 1 Parameters for adding a subscription Parameter
Description
Topic Name
Specifies the name of the topic to which messages are published.
Protocol
Specifies the protocol over which messages are sent. Possible values are SMS, FunctionGraph (function), DingTalk chatbot, WeCom chatbot, Lark chatbot, WeLink (red version), WeLink chatbot, Email, HTTP, and HTTPS.
Endpoint
Specifies the subscription endpoint. You can add up to 10 SMS, email, HTTP, or HTTPS endpoints, one in each line.
- SMS: Enter one or more valid phone numbers.
Examples:
+353876612345
+353 876612345
+353-876612345
+353/876612345
- Email: Enter one or more valid email addresses.
Examples:
username@example.com
username2@example.com
- HTTP: Enter one or more public network URLs.
Example:
http://example.com/notification/action
- HTTPS: Enter one or more public network URLs.
Example:
https://example.com/notification/action
- FunctionGraph (function): Click
to select a function and specify its version.
Request Header
This parameter is only available if HTTP or HTTPS is selected for Protocol. It indicates whether to configure the request header now. If you select Configure now, specify Key and Value. You can add up to 10 request headers.
The value of Key must:
- be case insensitive and unique.
- start with x- but cannot start with x-smn.
- contain only digits, letters, and hyphens (-), but not end with a hyphen nor contain consecutive hyphens.
Availability Test
This parameter is only available if HTTP or HTTPS is selected for Protocol. Click Start to check the real-time connectivity between SMN and HTTP/HTTPS endpoints.
Version
This parameter is only available if FunctionGraph (function) is selected for Protocol. Select the version for the function. For details about how to create a version, see Managing Versions.
Description
Specifies the remarks of the subscription.
To modify the subscription remarks, click
in the Description column of the target subscription in the subscription list.
- SMS: Enter one or more valid phone numbers.
-
(Optional) Configure a subscription filtering policy to limit the scope of message publishing.
The default filtering policy applies to message attributes. If you have set a filtering policy and message attributes when publishing a message, the system determines whether to push the messages to subscribers based on the filtering policy.
Subscription filtering policies are configured in JSON. The following is an example.{ "filter_polices": [ { "name": "policy_name", "string_equals": [ "policy_value" ] } ] }
- Click OK.
The subscription you added is displayed in the subscription list.
- To prevent malicious users from attacking subscription endpoints, SMN limits the number of confirmation messages that can be sent to an endpoint within a specified period. For details, see section "Traffic Control on Subscription Confirmation" in Simple Message Notification User Guide.
- SMN does not check whether subscription endpoints exist when you add subscriptions.
- After you add a subscription or request subscription confirmation, SMN will send a confirmation message to the endpoints, and the link in the confirmation message will be valid for 48 hours.
- Subscription confirmation messages will be counted as messages sent and will be billed.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.