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.
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 |
| 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. |
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"
}
{
"Response": {
"RequestId": "527cc5c7-0413-33e9-2adc-632e0f6a9dff",
"DeviceId": "mna-test1",
"DataKey": "dasdfrfwer32e4r",
"Signature": "dasdfrfwer32e4r"
}
}
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 |
|---|---|
| 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. |
文档反馈