- What's New
- Function Overview
- Service Overview
- Getting Started
-
User Guide
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Cloud Eye Monitoring
- Logs
- Permissions Management
- Quotas
- Appendix
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Getting Started
- APIs
- Examples
- Permissions Policies and Supported Actions
- Public Parameters
- Out-of-Date APIs
- Appendix
- SDK Reference
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- How Is SMN Billed?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- What Are the Limitations on SMS Messages?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- Does SMN Always Use the Same Phone Number or Sender Name to Send SMS Messages?
- How Do I Obtain My Account ID?
- How Does a DingTalk, Internal DingTalk, Lark, or WeCom Chatbot Obtain Subscription Endpoints?
- Videos
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Logs
- Permissions Management
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference
-
User Guide (Paris Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Logs
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- What Are the Limitations on SMS Messages?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference (Paris Region)
-
User Guide (Kuala Lumpur Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- SMN Operation Recording
- Logs
- Permissions Management
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference (Kuala Lumpur Region)
-
User Guide (Ankara Region)
- Overview
- Getting Started
- Topic Management
- Subscription Management
- Message Template Management
- Permissions Management
- Quotas
-
FAQs
- What Are the Advantages of SMN?
- What Protocols Does SMN Support?
- What Are the Requirements for an SMN Topic Name?
- How Many Topics Can I Create?
- How Many Subscriptions Can Be Added to a Topic?
- How Many Messages Can Be Published to a Topic?
- How Many Message Templates Can I Create?
- Can I Add Subscriptions Using Multiple Protocols to a Topic?
- Can a Topic Creator Change Subscription Protocols in a Topic?
- Can I Change a Subscription Endpoint for a Topic?
- Can I Delete a Published Message?
- Does SMN Ensure That Messages Are Received by Subscription Endpoints?
- Will a Subscriber Receive the Same Message Multiple Times?
- Why Do Subscribers Fail to Receive Messages After I Publish Messages to a Topic?
- What Can I Do When Pictures in an Email Message Cannot Be Displayed?
- How Do I Obtain My Account ID?
- Appendix
- Change History
- API Reference (Ankara Region)
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Copied.
JSON Message Format
Description
The JSON format allows you to specify different message content for different subscription protocols, including Default, SMS, HTTP, HTTPS, and Email. The message content you specify will be sent to subscription endpoints using applicable protocols.
{ "default": "Dear Sir or Madam, this is a default message.", "email": "Dear Sir or Madam, this is an email message.", "http": "{'message':'Dear Sir or Madam, this is an HTTP message.'}", "https": "{'message':'Dear Sir or Madam, this is an HTTPS message.'}" "sms": "This is an SMS message." }
It is recommended that you specify general message content for all subscription types in the Default protocol and enter customized content for specific protocols.
In the following example, you enter a shorter message for the SMS protocol because of the length limit on SMS messages. SMS subscribers in the topic receive the message "This is an SMS message.", while other types of subscribers (email, HTTP, and HTTPS) receive the one "Dear Sir or Madam, this is a default message."
{ "sms": "This is an SMS message.", "default": "Dear Sir or Madam, this is a default message." }
Constraints
- The content must be in JSON format.
- You must configure the Default protocol in the JSON message.
- The size of a JSON message cannot exceed 256 KB.
Calculation on the Size of a JSON Message
The size of a JSON message, including braces, quotation marks, spaces, line breaks, protocols, and message content, cannot exceed 256 KB. The size of a JSON message generated for each protocol may vary.
For example, message content "This is a default message." contains 26 bytes.
The system automatically adds the Default protocol when generating a JSON message.
{ "default": "This is a default message.", "protocol1": "This is a default message.", "protocol2": "This is a default message.", ... }
The total number of protocols is N, including the Default protocol and those you selected.
- Three spaces in each of the N protocols: 3 x N = 3N bytes
- Four quotation marks in each of the N protocols: 4 x N = 4N bytes
- One colon in each of the N protocols: 1 x N = N bytes
- Message content "This is a default message." in each of the N protocols: 26 x N = 26N bytes
- Commas in (N – 1) protocols: 1 x (N – 1) = (N – 1) bytes
- Line breaks in (N + 1) protocols: 1 x (N + 1) = (N + 1) bytes
- Two braces: 2 bytes
- Protocol name Default: 7 bytes
- HTTP: 4 bytes
- HTTPS: 5 bytes
- Email: 5 bytes
- SMS: 3 bytes
Total size = 36N + 9 + Bytes of protocols you selected
For example, you selected the HTTP, HTTPS, and email protocols, and the message is as follows:
{ "default": "This is a default message.", "email": "This is a default message.", "http": "This is a default message.", "https": "This is a default message." }
The system adds a Default protocol, and the value of N is 4. The size of this JSON message is:
- Fixed length: 36 x 4 + 9 = 153 bytes
- http: 4 bytes
- https: 5 bytes
- email: 5 bytes
The total size is 167 bytes (153 + 4 + 5 + 5 = 167).
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot