dingtalk.oapi.smartdevice.batchevent.post (智能硬件云云对接设备数据批量上报)

提供给企业批量上报业务数据接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
device_event_vos DeviceEventVo [] 可选
  • 最大列表长度:999
  • 自动创建
    • └ data
    • String
    • 可选
    • {"card":"123456"}
    • 默认值:{"card":"123456"}
    • json格式的数据体
    • └ topic
    • String
    • 可选
    • /xxx/xxx
    • 默认值:/xxx/xxx
    • 事件对应的topic
    • └ dn
    • String
    • 可选
    • 12312312
    • 默认值:12312312
    • 设备名称
    • └ pk
    • String
    • 可选
    • sdx1234214
    • 默认值:sdx1234214
    • 产品key

    响应参数

    名称 类型 示例值 描述
    result Boolean result 返回结果
    success Boolean false 是否成功
    errcode Number 40001 错误代码
    errmsg String 系统繁忙 错误信息

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/smartdevice/batchevent/post");
    OapiSmartdeviceBatcheventPostRequest req = new OapiSmartdeviceBatcheventPostRequest();
    List<DeviceEventVo> list2 = new ArrayList<DeviceEventVo>();
    DeviceEventVo obj3 = new DeviceEventVo();
    list2.add(obj3);
    obj3.setData("{\"card\":\"123456\"}");
    obj3.setTopic("/xxx/xxx");
    obj3.setDn("12312312");
    obj3.setPk("sdx1234214");
    req.setDeviceEventVos(list2);
    OapiSmartdeviceBatcheventPostResponse rsp = client.execute(req, access_token);
    System.out.println(rsp.getBody());

    响应示例

    • JSON示例
    {
        "result":result,
        "success":false,
        "errcode":40001,
        "errmsg":"系统繁忙"
    }

    异常示例

    • JSON示例
    {
    	"errcode":88,
    	"errmsg":"ding talk error"
    }

    错误码解释

    错误码 错误描述 解决方案

    API工具

    如何获得此API

    FAQ

    返回
    顶部