V2.5 Create Device Group¶
Create device groups.
Request Format¶
POST https://{apigw-address}/connect-service/v2.5/deviceGroups?action=createGroup
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 |
---|---|---|---|
name |
Mandatory |
StringI18n |
The device group name. For more details on the structure and locales supported, see Internationalized name struct. |
desc |
Optional |
String |
Firmware descriptions |
type |
Mandatory |
String |
Device group type: STATIC, DYNAMIC. |
condition |
Optional |
String |
Conditions of the dynamic device group |
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. |
data |
String |
Device group ID. |
Error Codes¶
Code |
Message |
---|---|
900 |
Condition error of dynamic group. |
901 |
Exceed device max limit of static group. |
902 |
Exceed static group max limit of device. |
903 |
Exceed static group max limit. |
904 |
Exceed dynamic group max limit. |
905 |
Exceed initial device max limit of dynamic group. |
906 |
Device is already in a static group. |
906 |
device is not in static group. |
404 |
Device group can not be found. |
500 |
Internal error. |
400 |
Invalid argument. |
Samples¶
Request Sample¶
url:https://{apigw-address}/connect-service/v2.5/deviceGroups?action=createStaticGroup&orgId=yourOrgId
method: POST
requestBody:
{
"name": {
"defaultValue": "GroupName-test",
"i18nValue": {
"en_US": "name",
"zh_CN": "中文名",
"es_ES": "nombre",
"ja_JP": "名前"
}
},
"desc": "deviceGroupDescription"
}
Return Sample¶
{
"code": 0,
"msg": "OK",
"requestId": "d0c39299-912a-44c5-8894-cf893352f9ab",
"data": "devicegroupid"
}