小鹰开放平台设备管理文档v1.1.15

2.1.10、获取设备p2p信息

POSThttps://open.eye4cloud.com/{{open_id}}/open/v1/device/getP2pInfo
请求数据
字段名 类型 是否必填 备注
device_id string 是 设备唯一id(可以使用 IMEI)
timestamp int64 是 时间戳,单位:秒
nonce string 是 随机字符串,8~20个字符
sign string 是 具体实现方法,请参考《生成sign的示例代码》
生成sign时data字段
imei string 否 设备IMEI,可传空字符串
data string 否 自定义data,可传空字符串
password string 是 设备密码
请求示例
JSON
{
    "device_id": "xxx",
    "timestamp": 1755685731,
    "nonce": "dask43hfad",
    "sign": "xxxxxxx",
    "password": ""
}
CURL请求示例
CURL
curl 'https://open.eye4cloud.com/xxxxx/open/v1/device/getP2pInfo' \
  -H 'Content-Type: application/json' \
  --data-raw '{
    "device_id": "xxx",
    "timestamp": 1757472185,
    "nonce": "",
    "sign": "",
    "password": ""
}'
返回数据
字段名 类型 备注
error_code int 状态码:0正常,其他异常
error_message string 错误信息:正常为success
data.p2pid string 设备p2pid
data.initstring string p2p加密字符串
data.type int 类型(0自研,1尚云)
data.vpType int app连接使用

示例:

JSON
{
    "error_code": 0,
    "error_message": "success",
    "error_tips": "",
    "data": {
      "p2pid": "xxxx",
      "initstring": "skadjh123",
      "type": 0
      "vpType":0
    }
}