Domain name for API request: iss.intl.tencentcloudapi.com.
This API is used to add a single device. After the device is added, configure it based on the returned results, then wait for device registration or stream pushing.
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: AddUserDevice. |
| Version | Yes | String | Common Params. The value used for this API: 2023-05-17. |
| Region | Yes | String | Common Params. For more information, please see the list of regions supported by the product. |
| Name | Yes | String | Device name, only supports Chinese, English, numbers, spaces, Chinese and English parentheses, _, -, length not exceeding 128 characters; (device name no need to be globally unique and can be duplicated) |
| AccessProtocol | Yes | Integer | Device access protocol (1: RTMP, 2: GB, 6: ISUP) Enumeration values:
Default value: 2 |
| Type | Yes | Integer | Device type. 1: IPC; 2: NVR. (If the device access protocol is RTMP, only select IPC as the device type.) Enumeration values:
|
| OrganizationId | Yes | String | ID of the organization to which the device belongs. Obtain from the organization query api DescribeOrganization. |
| ClusterId | Yes | String | Device access service node ID (Value field obtained from the DescribeRegionDomain API for querying available service nodes of a device) |
| TransportProtocol | No | Integer | Device streaming protocol. 1: UDP, 2: TCP. (Valid for national standard devices. UDP by default if not specified) |
| Password | No | String | Device password (required for national standard devices, length of 1-64 characters) |
| Description | No | String | Device description, length not exceeding 128 characters |
| GatewayId | No | String | Device access gateway ID (deprecated, reserved for compatibility, can be ignored) |
| ProtocolType | No | Integer | Gateway access protocol type (deprecated, reserved for compatibility, can be ignored) |
| Ip | No | String | Device access IP (deprecated, reserved for compatibility, can be ignored) |
| Port | No | Integer | Device port (deprecated, reserved for compatibility, can be ignored) Value range: [1, 65535] Unit: port |
| Username | No | String | Device username (deprecated, reserved for compatibility, can be ignored) |
| SNCode | No | String | Device SN (deprecated, reserved for compatibility, can be ignored) |
| AppName | No | String | Custom AppName for RTMP publishing address (required for RTMP only, support English, digits, _, -, ., length not exceeding 64 characters) |
| StreamName | No | String | Custom StreamName for RTMP publishing address (required for RTMP only, supports English, digits, _, -, ., length not exceeding 64 characters) |
| Parameter Name | Type | Description |
|---|---|---|
| Data | AddDeviceData | Add device response data. |
| 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. |
POST / HTTP/1.1
Host: iss.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddUserDevice
<Common request parameters>
{
"Name": "rtmp10087",
"AccessProtocol": 1,
"Type": 1,
"OrganizationId": "192",
"ClusterId": "4169d92e-****-****-****-************"
}
{
"Response": {
"Data": {
"AccessProtocol": 1,
"AppId": 1300000000,
"ClusterId": "4169d92e-****-4c16-****-d313****0790",
"ClusterName": "Shanghai Zone 1",
"Code": "0******Ofl",
"Description": "",
"GatewayId": "",
"DeviceId": "********-53e4-****-a16e-*************",
"Ip": "",
"Name": "rtmp10087",
"OrganizationId": 1000192,
"Password": "",
"Port": 0,
"TransportProtocol": 0,
"Type": 1,
"Username": "",
"ProtocolType": 1,
"Status": 1
},
"RequestId": "6836e76d-8e7d-48d3-98c2-bc0df3bf23c2"
}
}
Success
POST / HTTP/1.1
Host: iss.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddUserDevice
<Common request parameters>
{
"Name": "testrtmp",
"AccessProtocol": 1,
"Type": 1,
"OrganizationId": "189",
"ClusterId": "4169d92e-****-****-****-************",
"AppName": "testapp",
"StreamName": "teststream"
}
{
"Response": {
"Data": {
"AccessProtocol": 1,
"AppId": 1300056079,
"ClusterId": "4169d92e-****-****-****-************",
"ClusterName": "Shanghai Zone 1",
"Code": "0HQq******",
"Description": "",
"DeviceId": "f1f9baae-****-****-****-************",
"GatewayId": "",
"Ip": "",
"Name": "testrtmp",
"OrganizationId": 189,
"Password": "37********10",
"Port": 0,
"ProtocolType": 0,
"Status": 0,
"TransportProtocol": 0,
"Type": 1,
"Username": ""
},
"RequestId": "56d8591d-85cb-498d-a5b6-52133305e69c"
}
}
POST / HTTP/1.1
Host: iss.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddUserDevice
<Common request parameters>
{
"Name": "rtmp10086",
"AccessProtocol": 1,
"Type": 2,
"OrganizationId": "10092",
"ClusterId": "********-60ad-*****-ac7e-d******dd0790"
}
{
"Response": {
"Error": {
"Code": "InvalidParameterValue.InvalidDeviceType",
"Message": "Invalid device type"
},
"RequestId": "d4a82b07-08a2-47ba-8f22-04ce429a0dcd"
}
}
POST / HTTP/1.1
Host: iss.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddUserDevice
<Common request parameters>
{
"Name": "rtmp10086",
"AccessProtocol": 1,
"Type": 2,
"OrganizationId": "10092",
"ClusterId": "12345678-****-****-****-************"
}
{
"Response": {
"Error": {
"Code": "InvalidParameterValue",
"Message": "Invalid parameter."
},
"RequestId": "1647459e-2715-4adb-a074-0c3d4df7d6a4"
}
}
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 |
|---|---|
| InvalidParameter | Invalid input parameter |
| InvalidParameterValue.InvalidClusterId | Invalid cluster ID. The length or content does not conform to rules. |
| InvalidParameterValue.InvalidDescription | Incorrect description. |
| InvalidParameterValue.InvalidDevicePasswordLength | The device password must be greater than 1 character and less than 64 characters in length. |
| InvalidParameterValue.InvalidGatewayProtocolType | Invalid gateway access protocol. |
| InvalidParameterValue.InvalidIpv4 | Invalid Ipv4 addresses. |
| InvalidParameterValue.InvalidName | Name is empty or incorrect. |
| InvalidParameterValue.InvalidRTMPAppName | Invalid RTMP push AppName |
| InvalidParameterValue.InvalidRTMPStreamName | Invalid RTMP push StreamName |
| InvalidParameterValue.InvalidUsername | Invalid username. The length or content does not conform to rules. |
| InvalidParameterValue.RTMPPushStreamParamRepeat | Custom RTMP push AppName and StreamName cannot be duplicated |
| InvalidParameterValue.UnSupportedAccessType | Unsupported access type |
| RegionError.ResourceUnreachable | Resource unreachable. The resource is not within this region. |
| ResourceNotFound | Resource does not exist. |
| ResourceNotFound.NotFoundCluster | No available service nodes were found. |
| UnsupportedOperation.PushDomainNotExist | RTMP streaming domain not found |
文档反馈