Scenarios
This task guides you to subscribe to various Tencent Cloud message notifications by customizing a Webhook address.
Operation Steps
Obtaining a Webhook Address
You need to prepare a service endpoint (URL) that can receive HTTP POST requests. This address must meet the following requirements:
Accessible via a public network: If you are using an enterprise private network service, you may need to configure NAT traversal.
Supports POST requests: It can correctly parse JSON-formatted request bodies.
Capable of responding: It should return an HTTP 200 status code upon receiving a request to acknowledge receipt.
Creating a Bot
1. Log in to the Message Center console and go to the Recipient Management > Chatbot Reception Management page. 2. On the Chatbot Reception Management page, click Create Chatbot.
3. In the Create Chatbot window, configure the following information:
Chatbot type: Only a single chatbot is supported.
Chatbot platform: Select Custom Webhook.
Chatbot name: Enter a name for the chatbot.
Data format: Select the data format for your message push. After selection, messages will be pushed to the user's Webhook address in this format by default.
Webhook address: You can enter the corresponding address in the platform, for example: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=0*******62-b***8-48e3-***-60364293de43.
HTTP Header: After it is enabled, you can customize and configure message request headers in a Key-Value format, with support for adding up to 5 groups.
Signature obfuscation string: After it is enabled, an HmacSHA256 signature is automatically added to the Header when messages are pushed.
Webhook Captcha: Click Send Captcha to validate the Webhook.
4. In the chatbot creation process, click Send Captcha, then enter the Captcha to establish a connection with the custom chatbot.
5.After completing all information, click OK to create it successfully.
Testing Push Messages
2. In the pop-up window of Test Chatbot, enter the test content.
3. Click OK to send a test message.
4. View the test message in the platform Webhook.
Setting Up Bot Message Reception
1. Go to the Message Center console, click Subscription Management in the left navigation, and then go to the Subscription Management page. 2. Select the message types you want to subscribe to, click Modify Message Recipients, and then go to the Modify Message Recipients page.
3. On the Modify Message Recipients page, select Chatbot in the Recipients module, check the chatbot that needs to receive messages, and click OK to configure and add a chatbot under the product's sub-messages.
Attention:
Currently, chatbot message reception requires binding to an SMS channel.
4. After successful subscription, the message will be received at the Webhook address when the product subsequently triggers a Tencent Cloud message.