获取设备列表
            GET
        
        
        
            {host}/list_devices
        
    
            获取设备列表
        
    请求
        Query Parameters
    
    
    
    
    
                    
                        device_type
                    
                    
                
            
                string
            
            
                设备类型:1-gateway, 2-node(默认值)
            
        
                    
                        group_uuid
                    
                    
                
            
                string
            
            
                设备组唯一标识,默认返回默认分组,不传则返回所有分组
            
        响应
| 字段名称 | 说明 | 
|---|---|
| device_eui | 设备唯一标识 | 
| device_name | 设备名称 | 
请求示例
curl --request GET \
     --url {host}/list_devices?device_type=1&group_uuid=0C32119F38C89C31 \
     --user '<username>:<password>'
{
    "code": "0",
    "data": [
        {
            "device_eui": "2CF7F12010700088",
            "device_name": "设备2CF7F12010700088"
        },
        {
            "device_eui": "2CF7F1201070001C",
            "device_name": "设备2CF7F1201070001C"
        },
        {
            "device_eui": "2CF7F12104700010",
            "device_name": "US915-2CF7F12104700010"
        }
    ]
}
接口历史版本
| 历史版本 | 说明 | 
|---|---|
| Sensecap V1 | 已停止维护,不推荐使用 | 
获取设备详情
            POST
        
        
        
            {host}/view_devices
        
    
            获取设备详情信息
        
    请求
        Body Parameters
    
    
    
    
    
                    
                        device_euis
                    
                    
                    
            
                        (required)
                    
                    
                
                array
            
            
                设备唯一标识,一次最多查询50个设备
            
        
                    
                        device_type
                    
                    
                
            
                string
            
            
                设备类型:1-gateway, 2-node(默认值)
            
        响应
| 字段名称 | 说明 | 
|---|---|
| frequency | 设备通信频率 | 
| device_eui | 设备唯一标识 | 
| device_name | 设备名称 | 
| device_network | 组网协议, 1:LoRaWAN,2:NB-IoT,3:2G , 4:LoRaPP | 
| position | 设备GPS位置,latitude: 经度, latitude: 纬度 | 
| position_source | GPS位置来源,0-手动设置的位置,1-设备上报的位置 | 
| hardware_version | 设备硬件版本号 | 
| software_version | 设备软件版本号 | 
| sim | 设备上的sim卡信息 | 
| iccid | ICCID | 
| msisdn | MSISDN | 
| activateTime | 激活日期 | 
| expiryDate | 计费结束日期 | 
| status | 状态, 0-未知,1-正常,2-单项停机,3-停机,4-预销号,5-销号,6-过户,7-休眠,8-待激活 | 
| flow | 当月已用流量 | 
| residueFlow | 剩余流量 | 
请求示例
curl --request POST \
     --url {host}/view_devices \
     --data '{"device_type":1, "device_euis":["2CF7F15000100122"]}' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --user '<username>:<password>'
{
    "code": "0",
    "data": [
        {
            "frequency": "470",
            "device_eui": "2CF7F15000100122",
            "device_name": "设备2CF7F15000100122",
            "device_network": 2,
            "position": {
                "latitude": 113.931225,
                "longitude": 22.569792
            },
            "position_source": 0,
            "hardware_version": "",
            "software_version": "23.0",
            "sim": {
                "iccid": "89860446091891237424",
                "msisdn": "1440467057424",
                "activateTime": "2019-12-03T00:00:00.000Z",
                "expiryDate": "2020-11-30T00:00:00.000Z",
                "status": 1,
                "flow": 0,
                "residueFlow": 1024
            }
        }
    ]
}
接口历史版本
| 历史版本 | 说明 | 
|---|---|
| Sensecap V1 | 已停止维护,不推荐使用 | 
获取节点通道列表
            POST
        
        
        
            {host}/list_device_channels
        
    
            获取设备通道列表
        
    请求
        Body Parameters
    
    
    
    
    
                    
                        device_euis
                    
                    
                    
            
                        (required)
                    
                    
                
                array
            
            
                设备唯一标识,一次最多查询50个设备
            
        响应
| 字段名称 | 说明 | 
|---|---|
| device_eui | 设备唯一标识 | 
| channel_index | 通道编号 | 
| sensor_id | 传感器id | 
| sensor_status | 传感器状态:0-闲置 1-正常 2-异常 | 
| channel_type | 通道类型:1: 485 Sensor;2: Seeed Sensor;3: 485 Output;4: Seeed Output | 
| sensor_type | 传感器类型 | 
| channel_name | 通道名称 | 
| measurement_ids | 测量值id | 
请求示例
curl --request POST \
     --url {host}/list_device_channels \
     --data '{"device_euis":["2CF7F15000100147","2CF7F16221200060"]}' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --user '<username>:<password>'
     
     
{
    "code": "0",
    "data": [
        {
            "device_eui": "2CF7F15000100147",
            "channels": [
                {
                    "channel_index": 1,
                    "sensor_id": "2CF7F13011900006",
                    "sensor_status": 1,
                    "channel_type": 2,
                    "sensor_type": "1005",
                    "channel_name": "",
                    "measurement_ids": [
                        "4101"
                    ]
                }
            ]
        },
        {
            "device_eui": "2CF7F16221200060",
            "channels": [
                {
                    "channel_index": 11,
                    "sensor_id": "0111006221200060",
                    "sensor_status": 1,
                    "channel_type": 1,
                    "sensor_type": "2001",
                    "channel_name": "",
                    "measurement_ids": [
                        "4097",
                        "4105"
                    ]
                }
            ]
        }
    ]
}
获取设备工作状态
            POST
        
        
        
            {host}/view_device_running_status
        
    
            获取设备工作状态
        
    请求
        Body Parameters
    
    
    
    
    
                    
                        device_euis
                    
                    
                    
            
                        (required)
                    
                    
                
                array
            
            
                设备唯一标识,一次最多查询50个设备
            
        响应
| 字段名称 | 说明 | 
|---|---|
| device_eui | 设备唯一标识 | 
| latest_message_time | 设备最后上报消息的时间 | 
| online_status | 在线状态:0-离线,1-在线 | 
| battery_status | 电池电量状态:0-低电量 1-电量良好 | 
| report_frequency | 设备上报频率,单位分钟, 返回-1则设备未上报该信息 | 
请求示例
curl --request POST \
     --url {host}/view_device_running_status \
     --data '{"device_euis":["2CF7F1101300001C","2CF7F16221200060"]}' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --user '<username>:<password>'
{
    "code": "0",
    "data": [
        {
            "device_eui": "2CF7F16221200060",
            "latest_message_time": "2020-04-20T07:06:32.944Z",
            "online_status": 0,
            "battery_status": 1,
            "report_frequency": 0
        },
        {
            "device_eui": "2CF7F1101300001C",
            "latest_message_time": "",
            "online_status": 0,
            "battery_status": 1,
            "report_frequency": -1
        }
    ]
}
获取传感器测量值列表
            GET
        
        
        
            https://sensecap-statics.seeed.cn/refer/def/sensor.json
        
    
            获取所有传感器的物理测量值列表,传感器测量值参考列表以文件的形式存储于云端,你可直接获取该文件。
        
    字段说明
| 字段名称 | 说明 | 
|---|---|
| zh-cn | 中文描述 | 
| en | 英文描述 | 
| sm | 记录了每个传感器类型对应的测量类型id | 
| rg | 测量值取值范围 | 
| sensorType | 传感器类型,记录每个传感器类型的名称 | 
| measurementId | 测量值id,记录每个测量值的名称及单位 | 
示例
{
	"zh-cn": {
		"sensorType": {
			"1001": "空气温湿度传感器",
			"1003": "光照强度传感器",
			...
		},
		"measurementId": {
			"4097": ["空气温度", "℃"],
			"4098": ["空气湿度", "%RH"],
			...
		}
	},
	"en": {
		"sensorType": {
			"1001": "Air Temperature and Humidity Sensor",
			"1003": "Light Intensity Sensor",
			...
		},
		"measurementId": {
			"4097": ["Air Temperature", "℃"],
			"4098": ["Air Humidity", "%RH"],
			...
		}
	},
	"sm": {
		"1001": ["4098", "4097"],
		"1003": ["4099"],
		...
	},
	"rg": {
		"4097": "-40~90",
		"4098": "0~100",
		...
	}
}
接口历史版本
| 历史版本 | 说明 | 
|---|---|
| Sensecap V1 | 已停止维护,不推荐使用 | 
绑定设备
            POST
        
        
        
            {host}/bind_device
        
    
            将设备绑定到账户下
        
    请求
        Body Parameters
    
    
    
    
    
                    
                        eui
                    
                    
                    
            
                        (required)
                    
                    
                
                string
            
            
                设备eui
            
        
                    
                        code
                    
                    
                    
            
                        (required)
                    
                    
                
                string
            
            
                设备code
            
        
                    
                        device_name
                    
                    
                
            
                string
            
            
                设备名称
            
        
                    
                        group_uuid
                    
                    
                
            
                string
            
            
                设备组唯一标识,可通过群组列表接口获取
            
        
                    
                        longitude
                    
                    
                
            
                string
            
            
                设备位置,经度
            
        
                    
                        latitude
                    
                    
                
            
                string
            
            
                设备位置,纬度
            
        请求示例
curl --request POST \
     --url '{host}/bind_device' \
     --user '<username>:<password>' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --data '{"code":"device code","eui":"device eui"}' \
     --include
{
    "code": "0",
    "data": {}
}
接口历史版本
| 历史版本 | 说明 | 
|---|---|
| Sensecap V1 | 已停止维护,不推荐使用 | 
设备解绑
            POST
        
        
        
            {host}/delete_devices
        
    
            解绑设备
        
    请求
        Body Parameters
    
    
    
    
    
                    
                        device_euis
                    
                    
                    
            
                        (required)
                    
                    
                
                array
            
            
                设备唯一标识,一次最多解绑50个设备
            
        请求示例
curl --request POST \
     --url {host}/delete_devices \
     --data '{"device_euis":["2CF7F15000100122"]}' \
     --header 'Content-Type: application/json; charset=utf-8' \
     --user '<username>:<password>'
{
    "code": "0",
    "data": {}
}
 
  