V4.0 Create DPS Device(Deprecated)¶
Create DPS devices.
This version will be deprecated. It is recommended to use V2.5 Create DPS Device.
Prerequisites¶
Ensure that the device group and registration group for the DPS device are both created in the EnOS Management Console.
Request Format¶
POST https://{apigw-address}/dps-service/v4.0/pvs/device?action=create
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Required |
String |
The organization ID which the device belongs to. How to get orgId>> |
Request Parameters (Body)¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
groupId |
Required |
String |
The registration group ID. |
count |
Required |
Integer |
The number of devices to create. |
desc |
Optional |
String |
The device description. |
batchTag |
Optional |
StringI18n |
The device creation batch tag. Internationalized name representation >> |
deviceData |
Optional |
Map (Key is of String type and the Value is of Integer, String, Enum or Date type) |
The device master data. The Key is the identifier of the master data and the value must correspond to the data type pf the master data. Ensure that you have created the master data or use the built-in master data. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
String Array |
The list of serial numbers of devices that were successfully created. |
Error Codes¶
Code |
Message |
Description |
---|---|---|
35400 |
OrgId/deviceCreateInfo is required |
The orgId or information of the device to be created is blank or invalid. |
35404 |
Group not found |
The registration group does not exist. |
35601 |
DeviceSn duplicated |
The device serial number already exists. |
Samples¶
Request Sample¶
url: https://{apigw-address}/dps-service/v4.0/pvs/device?action=create&orgId=yourOrgId
method: POST
requestBody:
{
"groupId": "yourGroupId",
"count": 1,
"desc": "description",
"batchTag": {
"defaultValue": "123"
},
"deviceData": {
"deviceSn": "yourDeviceSn"
}
}
Return Sample¶
{
"code": 0,
"msg": "OK",
"requestId": "6e13b720-20d8-4ab1-8f34-060f89e569ed",
"data": [
"yourDeviceSn"
]
}