header_logo
header_logo

获取网关详情

简要描述

  1. 获取网关详情

请求 URL

  1. https://openapi.mp.usr.cn/usrCloud/V6/device/getDevice

请求方式

  1. POST

请求参数

名称 必选/可选 类型 位置 说明
X-Access-Token 必选 String Header 登录成功时返回的登录凭证(注意:X-Access-Token 有效时间为2小时,两小时内可以重复使用,获取详情
Content-Type 必选 String Header 消息体的媒体类型,必须为”application/json”
deviceNo 必选 String Body 网关编号

响应参数

名称 类型 说明
data JSONObject 响应数据
info String 提示消息
status Integer 返回码

响应数据(data)

名称 类型 说明
deviceNo String 网关编号
projectId Integer 网关组织id
projectName String 网关组织名称
deviceName String 网关名称
deviceAddress deviceAddress 网关地址
deviceCreateTime Integer 网关创建时间
deviceUpdateTime Integer 网关修改时间
productModel Integer 网关型号id
productModelName String 网关型号名称
serialPortLimit Integer 网关串口个数
devicePosition String 网关经纬度
devicePositionType Integer 网关定位类型 (1 固定位置 2 自动定位)
deviceMac String 网关Mac
deviceImei String 网关Imei
deviceEnableStatus Integer 网关启用禁用状态(1 启用 0 禁用)
deviceFuncMonitor Integer 网关网络监测开关( 0 关闭 1 开启)
deviceFuncCloud Integer 网关云组态功能( 0 关闭 1 开启)
deviceIsTransProtocol Integer 网关是否开启透传( 0 关闭 1 开启)
devicePass String 网关通讯密码
deviceStatus JSONObject 网关状态
deviceTags JSONArray 网关标签
ownerUid Integer 所属用户id
devicePassword String 网关通讯密码

响应数据(deviceStatus)

名称 类型 说明
deviceNo String 网关编号
onlineOffline Integer 上下线 0:下线,1:上线
update Integer 升级 0:不升级,1:升级
set Integer 配置 0:不配置,1:配置中
monitorAlarm Integer 报警 0:不报警,1:报警中
onlineTime Integer 上线时间(时间戳秒)

响应数据(deviceTagSetDatas)

名称 必选/可选 类型 说明
tagName 必选 String 标签类别名称,不允许名称重复,例如:“功耗”
tagValue 必选 String 标签类别下的标签值名称,可设置多个,不允许名称重复,例如:“800W”

返回码说明

返回码 说明
0 成功
2014 网关不存在
5004 权限不足
5106 参数不完整
5126 请求太频繁

请求示例

  1. POST https://openapi.mp.usr.cn/usrCloud/V6/device/getDevice
  2. Content-Type: application/json
  3.  
  4. {
  5. "deviceNo": "00005842014003180940"
  6. }

响应示例

status: 0,info: ok

  1. Content-Type: application/json
  2.  
  3. {
  4. "status": 0,
  5. "data": {
  6. "deviceNo": "00005842014003180940",
  7. "projectId": 172808,
  8. "projectName": "根组织",
  9. "deviceName": "name123",
  10. "deviceAddress": "山东省济南市历下区龙奥南路",
  11. "productModel": 15,
  12. "productModelName": "未知型号",
  13. "serialPortLimit": 1,
  14. "tcpOrNbDeviceType": 0,
  15. "devicePosition": "117.12639941,36.6565542",
  16. "devicePositionType": 1,
  17. "deviceEnableStatus": 1,
  18. "deviceWeight": 0,
  19. "deviceFuncMonitor": 0,
  20. "deviceFuncCloud": 1,
  21. "deviceIsTransProtocol": 0,
  22. "devicePass": "12312312",
  23. "deviceStatus": {
  24. "deviceNo": "00005842014003180940",
  25. "onlineOffline": 1,
  26. "sync": 0
  27. },
  28. "cloudSetDevice": 0,
  29. "ownerUid": 5842
  30. },
  31. "info": "ok",
  32. "account": "***"
  33. }
方案咨询
联系方式