文档中心 > API类目 > 天猫精灵开放API

alibaba.iot.device.corpus.get (IoT设备支持语料获取)

ISV通过该接口获取天猫精灵IoT设备支持控制或查询的语料

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
user_open_id String 可选 sgC2EnQn764Fb3dndkPm+Sih/tt/CUeplOyC1w6yAeGXeauSgEtPyGhmXPQiVJXRfFGPWb4K8PNXxq2slxxxxx== 天猫精灵开放用户id
client_id String 可选 Vz0MZRvyjPWqF1rNHxxxxx 天猫精灵开放的client id
dev_id String 可选 780f778xxxxx iot设备id

响应参数

名称 类型 示例值 描述
ret_values DeviceCorpusTopDto [] 返回结构体
  • └ corpus_list
  • String []
  • ["打开灯","关闭灯"]
  • 操作语料
  • └ function_name
  • String
  • 开关
  • 支持的操作类型

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIotDeviceCorpusGetRequest req = new AlibabaIotDeviceCorpusGetRequest();
req.setUserOpenId("sgC2EnQn764Fb3dndkPm+Sih/tt/CUeplOyC1w6yAeGXeauSgEtPyGhmXPQiVJXRfFGPWb4K8PNXxq2slxxxxx==");
req.setClientId("Vz0MZRvyjPWqF1rNHxxxxx");
req.setDevId("780f778xxxxx");
AlibabaIotDeviceCorpusGetResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_iot_device_corpus_get_response>
    <ret_values>
        <device_corpus_top_dto>
            <corpus_list>
                <string>[&quot;打开灯&quot;</string>
                <string>&quot;关闭灯&quot;]</string>
            </corpus_list>
            <function_name>开关</function_name>
        </device_corpus_top_dto>
    </ret_values>
</alibaba_iot_device_corpus_get_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

返回
顶部