Skip to content

设备心跳提交

必要时,设备需要定时向服务器发送心跳包。

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

请求方法

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}/heartbeat/"

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

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

print(response.text)