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

See DeviceIdentifier Struct.

Response Parameters


Name

Data Type

Description

code

Number

Return code of a request.

msg

String

The explanation to the return code. Its value is OK if the request 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.

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
}