tencent cloud

AddDevice

Download
Modo Foco
Tamanho da Fonte
Última atualização: 2026-05-21 10:26:37

1. API Description

Domain name for API request: mna.intl.tencentcloudapi.com.

Create new device records

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

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: AddDevice.
Version Yes String Common Params. The value used for this API: 2021-01-19.
Region No String Common Params. This parameter is not required for this API.
DeviceName Yes String Name of the new device
Remark No String Remark of the created device
DataKey No String base64-encoded key string of the new device, optional. If not filled, automatically generated by the system.
Encrypted No Boolean Whether to set the preset key.
true: set preset key.
false: Leave the preset key unset.
AccessScope No Integer Access environment. 0: public cloud gateway; 1: private gateway; 2: public cloud gateway and private gateway. By default if left blank, public cloud gateway.
specific meaning
Public cloud gateway: The device can only integrate with the public cloud gateway (nearby access).
Private gateway: The device can only integrate with the already launched private gateway (nearby access or fixed ip integration).
Public cloud gateway and private gateway: The device can also integrate with the public cloud gateway and the already launched private gateway (connected to nearby or fixed ip access).
LicensePayMode No Integer license payment method
Monthly authorization
Permanent license
If not specified, it defaults to monthly authorization. To permanently license a device, you need to call the OrderPerLicense API to pay the authorization fee. Otherwise, the device cannot be used.
GroupName No String Device group name. Optional. Reserved parameter. GroupId must be imported when grouping is required.
GroupId No String Device group ID. Optional. If not filled, the default device is not grouped.
FlowTrunc No Integer No traffic processing method for the device. 0: pay-as-you-go, 1: truncate and accelerate

3. Output Parameters

Parameter Name Type Description
DataKey String base64-format key encrypted by the encryption algorithm
DeviceId String device ID
Signature String signature string
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.

4. Example

Example1 Create new device

Input Example

POST / HTTP/1.1
Host: mna.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: AddDevice
<Common request parameters>

{
    "DeviceName": "mna-test1",
    "Remark": "mna-test1",
    "DataKey": "mna-test1",
    "Encrypted": "false"
}

Output Example

{
    "Response": {
        "RequestId": "527cc5c7-0413-33e9-2adc-632e0f6a9dff",
        "DeviceId": "mna-test1",
        "DataKey": "dasdfrfwer32e4r",
        "Signature": "dasdfrfwer32e4r"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InternalError Internal error.
InternalError.ControlRequestError Request controller encounters an error.
InternalError.DuplicateDataKey Device key already exists.
InternalError.DuplicateDeviceName Device name already exists.
InternalError.UndefinedEncryptedKey Preset key not created.
InvalidParameterValue Parameter value error.

Ajuda e Suporte

Esta página foi útil?

comentários