阅读537 返回首页    go 微信


申请批量生成设备__接口列表_服务器端API_阿里云物联网套件-阿里云

申请批量生成设备

描述

本接口为 2016-05-30版本新发布接口

请求参数

名称 类型 是否必须 描述
<公共参数> 公共参数
ProductKey String 产品唯一ID
DeviceNames List 设备名称列表,一次最多允许1w台

返回参数

名称 类型 描述
RequestId String 表示调用返回码
Success Boolean 表示调用成功与否
ErrorMessage String 出错信息
ApplyId Long 申请ID

示例

  • 请求示例

    1. https://iot.aliyuncs.com/?Action=ApplyDeviceWithNamesRequest
    2. &roductKey=...
    3. &DeviceName.1=device_a
    4. &DeviceName.3=device_c
    5. &DeviceName.2=device_b
    6. &DeviceName.4=device01
    7. &<[公共请求参数]>
  • SDK示例代码 [SDK下载]

    • java

      1. ApplyDeviceWithNamesRequest request = new ApplyDeviceWithNamesRequest();
      2. List<String> devices = new ArrayList<String>();
      3. devices.add("device_a");
      4. devices.add("device_b");
      5. devices.add("device_c");
      6. devices.add("device01");
      7. request.setProductKey("...");
      8. request.setDeviceNames(devices);
      9. ApplyDeviceWithNamesResponse response = null;
      10. try {
      11. resp = client.getAcsResponse(req);
      12. } catch (ClientException e) {
      13. e.printStackTrace();
      14. }
      15. if(response != null){
      16. System.out.println("Response requestId:"+response.getRequestId()+" isSuccess:"+response.getSuccess() +" Error:"+response.getErrorMessage());
      17. }
    • php

      1. $request = new IotBatchGetDeviceStateRequest();
      2. $request->setRuleId(177);
      3. $request->setDeviceName("DeviceName.1=device_a&DeviceName.3=device_c&DeviceName.2=device_b&DeviceName.4=device01");
      4. $response = $client->getAcsResponse($request);
      5. print_r("rn");
      6. print_r($response);
    • python

      1. request = BatchGetDeviceStateRequest.BatchGetDeviceStateRequest()
      2. request.set_accept_format('json')
      3. request.set_RuleId(177);
      4. request.set_DeviceName('DeviceName.1=device_a&DeviceName.3=device_c&DeviceName.2=device_b&DeviceName.4=device01');
      5. result = clt.do_action(request)
      6. print 'publish : ' + result
  • 返回示例

    json示例

    1. {
    2. "RequestId":"BB71E443-4447-4024-A000-EDE09922891E",
    3. "Success":true,
    4. "ApplyID":68
    5. }

    XML示例

    1. <ApplyDeviceWithNamesResponse>
    2. <RequestId>70B70922-67BD-4506-ABFC-E99A2972809E</RequestId>
    3. <Success>true</Success>
    4. <ApplyID>68</ApplyID>
    5. </ApplyDeviceWithNamesResponse>

最后更新:2016-12-12 16:59:28

  上一篇:go 设备注册__接口列表_服务器端API_阿里云物联网套件-阿里云
  下一篇:go 查询申请批量生成设备状态__接口列表_服务器端API_阿里云物联网套件-阿里云