POST api/Device/Add
增加一个设备
Request Information
URI Parameters
None.
Body Parameters
M_AddDevice| Name | Description | Type | Additional information |
|---|---|---|---|
| ParentSN |
父节点SN |
integer |
Required |
| Name |
名称 |
string |
Required |
| IMEI |
设备序列号 |
string |
Required |
| ICCID |
设备卡号 |
string |
Required |
| Secret |
密码 |
string |
Required |
| AddCount |
批量追加数量 |
integer |
Required |
| Note |
备注信息 |
string |
Required |
| DeviceClassSN |
产品类别序号 |
integer |
Required |
| DeviceGroupSN |
产品分组序号 |
integer |
Required |
| StrategySN |
策略序号 |
integer |
Required |
| PSN |
协议序号 |
integer |
Required |
| Icon |
图标,如无指定,则根据产品分类自动生成。 |
string |
Required |
| Lat |
纬度 |
string |
Required |
| Lon |
经度 |
string |
Required |
| Cycle |
上报周期,如无指定,则根据产品分类自动生成 |
integer |
Required |
| Count |
终端数量,如无指定,则根据产品分类自动生成 |
integer |
Required |
Request Formats
application/json, text/json
Sample:
{
"ParentSN": 1,
"Name": "sample string 2",
"IMEI": "sample string 3",
"ICCID": "sample string 4",
"Secret": "sample string 5",
"AddCount": 6,
"Note": "sample string 7",
"DeviceClassSN": 8,
"DeviceGroupSN": 9,
"StrategySN": 10,
"PSN": 11,
"Icon": "sample string 12",
"Lat": "sample string 13",
"Lon": "sample string 14",
"Cycle": 15,
"Count": 16
}
application/xml, text/xml
Sample:
<M_AddDevice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.DP.Models"> <AddCount>6</AddCount> <Count>16</Count> <Cycle>15</Cycle> <DeviceClassSN>8</DeviceClassSN> <DeviceGroupSN>9</DeviceGroupSN> <ICCID>sample string 4</ICCID> <IMEI>sample string 3</IMEI> <Icon>sample string 12</Icon> <Lat>sample string 13</Lat> <Lon>sample string 14</Lon> <Name>sample string 2</Name> <Note>sample string 7</Note> <PSN>11</PSN> <ParentSN>1</ParentSN> <Secret>sample string 5</Secret> <StrategySN>10</StrategySN> </M_AddDevice>
application/x-www-form-urlencoded
Sample:
Sample not available.
Response Information
Resource Description
M_Response| Name | Description | Type | Additional information |
|---|---|---|---|
| Contant |
内容,包含返回所需要的类 |
Object |
Required |
| Status |
状态 |
integer |
Required |
| Msg |
信息 |
string |
Required |
| Num |
数值,数据变动条数或增加时返回的ID |
integer |
Required |
Response Formats
application/json, text/json
Sample:
{
"Contant": {},
"Status": 2,
"Msg": "sample string 3",
"Num": 4
}
application/xml, text/xml
Sample:
<M_Response xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebAPI.DP.Models"> <Msg>sample string 3</Msg> <Num>4</Num> <Status>2</Status> <Contant /> </M_Response>