文档中心 > API类目 > 智慧园区API

alibaba.campus.bs.device.query (活动设备查询)

查询当前活动的设备列表

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param DeviceQuery 必须 参数
  • └ space_name
  • String
  • 可选
  • 入口1
  • 出入口名称
  • └ activity_code
  • String
  • 必须
  • 1
  • 活动唯一标识
  • └ space_type
  • Number
  • 可选
  • 1
  • 出入口类型
  • └ access_key
  • String
  • 必须
  • 1
  • 访问授权
  • └ device_name
  • String
  • 可选
  • facepad-01
  • 设备名称
  • └ device_status
  • Number
  • 可选
  • 0
  • 设备状态
  • └ sponsor_code
  • String
  • 必须
  • xxx
  • 主办方标识

响应参数

名称 类型 示例值 描述
result Boolean true result
result_code String 200 错误码
content_list T [] 1 业务结果
  • └ device_name
  • String
  • facepad-01
  • 设备名称
  • └ device_status
  • Number
  • 0
  • 设备状态
  • └ space_type
  • Number
  • 1
  • 出入口类型
  • └ space_name
  • String
  • 入口1
  • 出入口名称
result_msg String success 错误信息

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaCampusBsDeviceQueryRequest req = new AlibabaCampusBsDeviceQueryRequest();
AlibabaCampusBsDeviceQueryRequest.DeviceQuery obj1 = new AlibabaCampusBsDeviceQueryRequest.DeviceQuery();
obj1.setSpaceName("入口1");
obj1.setActivityCode("1");
obj1.setSpaceType(1L);
obj1.setAccessKey("1");
obj1.setDeviceName("facepad-01");
obj1.setDeviceStatus(0L);
obj1.setSponsorCode("xxx");
req.setParam(obj1);
AlibabaCampusBsDeviceQueryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_campus_bs_device_query_response>
    <result>true</result>
    <result_code>200</result_code>
    <content_list>
        <t>
            <device_name>facepad-01</device_name>
            <device_status>0</device_status>
            <space_type>1</space_type>
            <space_name>入口1</space_name>
        </t>
    </content_list>
    <result_msg>success</result_msg>
</alibaba_campus_bs_device_query_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部