Domain name for API request: mqtt.intl.tencentcloudapi.com.
This API is used to add an MQTT role.
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: CreateUser. |
| 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 | Instance ID, obtained from the DescribeInstanceList api or console. |
| Username | Yes | String | Specifies the username, which cannot be empty, only supports numbers, uppercase and lowercase letters, and separators ("_", "-"), and must not exceed 32 characters. |
| Password | No | String | Specifies the password. if this field is empty, the backend performs default generation. when using a user-defined password, the value cannot be empty, only supports numbers, uppercase and lowercase letters, and separators ("_", "-"), and must not exceed 64 characters. |
| Remark | No | String | Specifies the remark with length not exceeding 128 characters. |
| Parameter Name | Type | Description |
|---|---|---|
| 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: CreateMQTTUser
<Common request parameters>
{
"InstanceId": "mqtt-12345",
"Remark": "remark",
"Username": "user1",
"Password": "user1-pd"
}{
"Error": null,
"RequestId": null,
"Response": {
"RequestId": "25cb77a7-2add-4086-8fd2-a05b5bd34776"
}
}
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 | Operation failed. |
| FailedOperation.InstanceNotReady | FailedOperation.InstanceNotReady |
| OperationDenied | Operation denied. |
| ResourceInUse | The resource is occupied. |
| ResourceNotFound.Instance | ResourceNotFound.Instance |
| UnsupportedOperation.ResourceAlreadyExists | UnsupportedOperation.ResourceAlreadyExists |
Feedback