Domain name for API request: mqtt.intl.tencentcloudapi.com.
This API is used to create a message enrichment rule.
A maximum of 20 requests can be initiated per second for this API.
The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.
| Parameter Name | Required | Type | Description |
|---|---|---|---|
| Action | Yes | String | Common Params. The value used for this API: CreateMessageEnrichmentRule. |
| Version | Yes | String | Common Params. The value used for this API: 2024-05-16. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| InstanceId | Yes | String | tencent cloud MQTT instance ID, obtained from the DescribeInstanceList api or console. |
| RuleName | Yes | String | Rule name |
| Condition | Yes | String | Rule matching conditions in JSON format, Base64 encoding is required. Creating a Billing Resource Order {"clientId":"client-1","username":"client-1","topic":"home/room1"} Specifies the Base64-encoded content. eyJjbGllbnRJZCI6ImNsaWVudC0xIiwidXNlcm5hbWUiOiJjbGllbnQtMSIsInRvcGljIjoiaG9tZS9yb29tMSJ9 |
| Actions | Yes | String | Specifies the action of rule execution in JSON format, which must be Base64 encoded. Creating a Billing Resource Order {"messageExpiryInterval":360,"responseTopic":"replies/devices/${clientid}","correlationData":"${traceid}","userProperty":[{"key":"trace-id","value":"${traceid}"}]} Specifies the BASE64-encoded value. eyJtZXNzYWdlRXhwaXJ5SW50ZXJ2YWwiOjM2MCwicmVzcG9uc2VUb3BpYyI6InJlcGxpZXMvZGV2aWNlcy8ke2NsaWVudGlkfSIsImNvcnJlbGF0aW9uRGF0YSI6IiR7dHJhY2VpZH0iLCJ1c2VyUHJvcGVydHkiOlt7ImtleSI6InRyYWNlLWlkIiwidmFsdWUiOiIke3RyYWNlaWR9In1dfQ== |
| Priority | Yes | Integer | Rule priority. a smaller number indicates a higher priority. high priority overwrites low-priority. the userproperty field will be merged. |
| Status | No | Integer | Rule status. valid values: 0 (undefined), 1 (activate), 2 (deactivate). default: deactivate. |
| Remark | No | String | Specifies the remark with length not exceeding 128 characters. |
| Parameter Name | Type | Description |
|---|---|---|
| InstanceId | String | Cluster ID. |
| Id | Integer | Rule ID |
| RequestId | String | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
This example shows you the example.
POST / HTTP/1.1
Host: mqtt.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: CreateMessageEnrichmentRule
<Common request parameters>
{
"InstanceId": "mqtt-g4r4wpne",
"RuleName": "rule1",
"Condition": "eyJjbGllbnRJZCI6ImNsaWVudC0xIiwidXNlcm5hbWUiOiJjbGllbnQtMSIsInRvcGljIjoiaG9tZS9yb29tMSJ9",
"Actions": "eyJtZXNzYWdlRXhwaXJ5SW50ZXJ2YWwiOjM2MCwicmVzcG9uc2VUb3BpYyI6InJlcGxpZXMvZGV2aWNlcy8ke2NsaWVudGlkfSIsImNvcnJlbGF0aW9uRGF0YSI6IiR7dHJhY2VpZH0iLCJ1c2VyUHJvcGVydHkiOlt7ImtleSI6InRyYWNlLWlkIiwidmFsdWUiOiIke3RyYWNlaWR9In1dfQ==",
"Priority": 2,
"Status": 1,
"Remark": "remark"
}{
"Error": null,
"RequestId": null,
"Response": {
"Id": 6,
"InstanceId": "mqtt-g4r4wpne",
"RequestId": "63e5ecf1-3d79-4f28-aef3-6e7396f78dcd"
}
}
TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.
The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.
| Error Code | Description |
|---|---|
| FailedOperation.InstanceNotReady | FailedOperation.InstanceNotReady |
Feedback