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

taobao.ailab.aicloud.top.message.sendaudio (发送语音留言)

将语音的二进制byte[]通过TOP接口发送保存

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
schema String 必须 36653b6e-f41a-11e6-bc64- 92361f002671 账户体系隔离
user_id String 必须 13911112222 用户ID,此处传入第三方账户体系的用户 id
utd_id String 可选 V944n0HrnZ4DAAtOStvvDat7 用户设备唯一识别码,长度限制32以内, 建议使用系统接口获取deviceid, 然后做一定的混淆处理来作为此输入参数
ext String 可选 {"appType":"device","appVersion": "1.0"} 扩展信息,用于存放APP类型等
message byte[] 必须 123 语音的二进制

响应参数

名称 类型 示例值 描述
result AiCloudResult {} result
  • └ model
  • String
  • http://test.com
  • 语音地址
  • └ msg_code
  • String
  • 200
  • msgCode
  • └ msg_info
  • String
  • success
  • msgInfo
  • └ is_success
  • Boolean
  • true
  • success

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AilabAicloudTopMessageSendaudioRequest req = new AilabAicloudTopMessageSendaudioRequest();
req.setSchema("36653b6e-f41a-11e6-bc64- 92361f002671");
req.setUserId("13911112222");
req.setUtdId("V944n0HrnZ4DAAtOStvvDat7");
req.setExt("{\"appType\":\"device\",\"appVersion\": \"1.0\"}");
req.setMessage(new FileItem("/tmp/file.txt"));
AilabAicloudTopMessageSendaudioResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<ailab_aicloud_top_message_sendaudio_response>
    <result>
        <model>http://test.com</model>
        <msg_code>200</msg_code>
        <msg_info>success</msg_info>
        <is_success>true</is_success>
    </result>
</ailab_aicloud_top_message_sendaudio_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

返回
顶部