V2.5 Add Device to Device Group¶
Add devices to device groups
Request Format¶
POST https://{apigw-address}/connect-service/v2.5/deviceGroups?action=addDeviceToDeviceGroup
Request Parameters (URI)¶
Name  | 
Location (Path/Query)  | 
Mandatory/Optional  | 
Data Type  | 
Description  | 
|---|---|---|---|---|
orgId  | 
Query  | 
Mandatory  | 
String  | 
The organization ID which the asset belongs to. How to get orgId>>  | 
Request Parameters (Body)¶
Name  | 
Mandatory/Optional  | 
Data Type  | 
Description  | 
|---|---|---|---|
groupId  | 
Mandatory  | 
String  | 
Device group ID  | 
deviceIdentifier  | 
Mandatory  | 
Struct  | 
DeviceIdentifier Struct ¶
Name  | 
Data Type  | 
Description  | 
|---|---|---|
assetId  | 
String  | 
The asset ID. How to get assetId>>  | 
productKey  | 
String  | 
Product Key.  | 
deviceKey  | 
String  | 
Device Key.  | 
Response Parameters¶
Name  | 
Data Type  | 
Description  | 
|---|---|---|
code  | 
Number  | 
Return code of a request.  | 
msg  | 
String  | 
The explanation to the return code. Its value is   | 
requestId  | 
String  | 
A unique ID to identify a request.  | 
successSize  | 
Integer  | 
The number of sucessfully created devices.  | 
totalSize  | 
Integer  | 
The total number of devices to be created.  | 
data  | 
Device Struct Array  | 
For more information, see Device Struct.  | 
Device Struct ¶
Name  | 
Data Type  | 
Description  | 
|---|---|---|
code  | 
number  | 
Failed or succeeded to create an alert. 0: succeeded, -1: failed.  | 
msg  | 
String  | 
Returns   | 
data  | 
String  | 
The information about creating device groups.  | 
Samples¶
Request Sample¶
url:https://{apigw-address}/connect-service/v2.5/deviceGroups?action=addDeviceToDeviceGroup&orgId=yourOrgId
method: POST
requestBody:
{
    "deviceIdentifiers": [{
        "deviceKey": "deviceKey",
        "productKey": "productKey"
    }]
}
Return Sample¶
 {
    "code": 0,
    "msg": "OK",
    "requestId": "bf03cfa6-8be5-4297-886a-d55d66cad4d9",
    "data": [{
        "code": 0,
        "msg": "OK",
        "data": "DeviceIdentifier(assetId=null, productKey=productKey, deviceKey=deviceKey)"
    }],
    "successSize": 1,
    "totalSize": 1
}