Skip to content

获取设备详情

获取单个设备详细信息。

https://agri-dl.holdingbyte.com/api/device/{{device_id}}

请求方法

GET

请求参数

返回数据

字段类型说明
agri_idstring设备内部id
device_idstring设备id
device_namestring设备名称
device_modelstring设备型号
the_typeint设备类型
imagestring设备图片url
infostring设备信息

数据示例:

{
    "agri_id": "d-1000-yczqcwxdjptw",
    "device_id": "861714053848887",
    "device_name": "温湿度采集器",
    "device_model": null,
    "image": "https://agri-static.holdingbyte.com/cms/media/upload/basedevice/602c8588-4d5f-49f5-9f6e-4340f48c3da0.jpg",
    "info": "测试2"
}

示例代码

python

import requests

# 设备ID
device_id = "861714053848887"

# 请求token
token = "hvduasqoqnbtscaiumzsgpjewxkrgupq"

url = f"https://agri-dl.holdingbyte.com/api/device/{device_id}"

payload = {}
headers = {
  'token': token,
  'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)