alibaba.interaction.im.assistant.file.send (阿里卖家APP插件销售助手发送文件)

阿里卖家APP插件销售助手发送文件

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
file_info NodeDTO 必须 文件信息
  • └ file_name
  • String
  • 必须
  • test.mp4
  • 文件全名
  • └ file_size
  • Number
  • 必须
  • 7546310
  • 文件大小(B)
  • └ material_type
  • String
  • 必须
  • mp4
  • 文件自定义类型
  • └ md5
  • String
  • 必须
  • 4a97dfe2e74071fe997a05e44db92e12
  • 文件的 md5 值
scene_dto SceneDTO 必须 上传的基本逻辑信息封装,当前用户id 和类型 必须制定,这个必须要有
  • └ scene_type
  • Number
  • 必须
  • 1
  • 场景类型
  • └ from_account_id
  • String
  • 必须
  • 111
  • 发送人阿里账号ID
  • └ to_account_id
  • String
  • 必须
  • 222
  • 接收人阿里账号ID
  • └ id_type
  • Number
  • 必须
  • 3
  • ID类型,[账号ID:3]
params String 必须 {"source":"","needCardUrl":true} 额外字段,如果有特殊需求,用于填入特殊字段内容

响应参数

名称 类型 示例值 描述
result ApiResult 返回结果
  • └ success
  • Boolean
  • true
  • 成功标识
  • └ code
  • Number
  • 200
  • 错误码
  • └ msg
  • Number
  • 系统错误
  • 错误信息
  • └ ext_msg
  • String
  • {"code":100,"msg":"系统错误"}
  • 扩展错误信息
  • data
  • NodeDTO
  • 结果数据
  • └ id
  • Number
  • 2395872215
  • 文件ID
  • └ parent_id
  • Number
  • 1410129110
  • 父级ID
  • └ gmt_create
  • String
  • 2024-03-19 23:15:46
  • 创建时间
  • └ gmt_modified
  • String
  • 2024-03-19 23:15:46
  • 修改时间
  • └ gmt_modified_long
  • Number
  • 1710915346000
  • 修改时间戳
  • └ node_name
  • String
  • 卡比.jpg
  • 文件名
  • └ node_size
  • Number
  • 98142
  • 文件大小
  • └ node_type
  • String
  • file
  • 文件分类
  • └ material_type
  • String
  • jpg
  • 文件类型
  • └ bucket
  • String
  • hz-icbuim-file
  • 文件桶
  • └ md5
  • String
  • 39de172192ac999928cb7281a002b07b
  • MD5
  • └ oss_key
  • String
  • file/39de172192ac999928cb7281a002b07b.jpg
  • 文件OSS地址
  • └ thumbnail_url
  • String
  • https://clouddisk.alibaba.com/file/videoThumb.htm?appkey=OneChat&id=2395872215&parentId=1410129110&secOperateAliId=MC1IDX1PdpBbUR4ZAdxk7EoU5xolGUK0AvxyRHINIaffaPTN9ys-tFJfkgK3hqTdUIn9Bsn&scene=1
  • 缩略图地址
  • └ redirect_file_url
  • String
  • https://clouddisk.alibaba.com/file/redirectFileUrl.htm?appkey=OneChat&id=2395872215&parentId=1410129110&secOperateAliId=MC1IDX1antcSTkb4vXpGol-w4lniwSuaJyPVfJl2I9X2ama_xpUGdBRwbj4GnoToC5WXknk&fileAction=imagePreview&scene=1
  • 重定向地址
  • └ file_card_url
  • String
  • https://workspace.alibaba.com/card?type=13&from=cn1531680279gldp&to=cn1530216743exhd&picWidth=1080&picHeight=1036&extensionType=jpg&id=2395872215&orgSize=1080x1036&version=1&parentId=1410129110&md5=39de172192ac999928cb7281a002b07b&ctime=1710915346808&sign=9E49FA7B2F4905024DFE06992DC150DFACE0877E
  • 文件卡片地址
  • └ source
  • String
  • hz
  • 来源
  • └ view_status
  • Number
  • 0
  • 查看状态
  • extend
  • JSONObject
  • 扩展
  • └ private_chat_name
  • String
  • OneChat|2207670947568|2207975307058
  • 私聊名称
  • └ creator
  • Number
  • 2207975307058
  • 私聊创建者ID
  • └ gmt_create_long
  • Number
  • 1710915346000
  • 创建时间戳

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaInteractionImAssistantFileSendRequest req = new AlibabaInteractionImAssistantFileSendRequest();
AlibabaInteractionImAssistantFileSendRequest.NodeDTO obj1 = new AlibabaInteractionImAssistantFileSendRequest.NodeDTO();
obj1.setFileName("test.mp4");
obj1.setFileSize(7546310L);
obj1.setMaterialType("mp4");
obj1.setMd5("4a97dfe2e74071fe997a05e44db92e12");
req.setFileInfo(obj1);
AlibabaInteractionImAssistantFileSendRequest.SceneDTO obj2 = new AlibabaInteractionImAssistantFileSendRequest.SceneDTO();
obj2.setSceneType(1L);
obj2.setFromAccountId("111");
obj2.setToAccountId("222");
obj2.setIdType(3L);
req.setSceneDto(obj2);
req.setParams("{\"source\":\"\",\"needCardUrl\":true}");
AlibabaInteractionImAssistantFileSendResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<alibaba_interaction_im_assistant_file_send_response>
    <result>
        <success>true</success>
        <code>200</code>
        <msg>系统错误</msg>
        <ext_msg>{&quot;code&quot;:100,&quot;msg&quot;:&quot;系统错误&quot;}</ext_msg>
        <data>
            <id>2395872215</id>
            <parent_id>1410129110</parent_id>
            <gmt_create>2024-03-19 23:15:46</gmt_create>
            <gmt_modified>2024-03-19 23:15:46</gmt_modified>
            <gmt_modified_long>1710915346000</gmt_modified_long>
            <node_name>卡比.jpg</node_name>
            <node_size>98142</node_size>
            <node_type>file</node_type>
            <material_type>jpg</material_type>
            <bucket>hz-icbuim-file</bucket>
            <md5>39de172192ac999928cb7281a002b07b</md5>
            <oss_key>file/39de172192ac999928cb7281a002b07b.jpg</oss_key>
            <source>hz</source>
            <view_status>0</view_status>
            <extend>
                <private_chat_name>OneChat|2207670947568|2207975307058</private_chat_name>
                <creator>2207975307058</creator>
            </extend>
            <gmt_create_long>1710915346000</gmt_create_long>
        </data>
    </result>
</alibaba_interaction_im_assistant_file_send_response>

异常示例

  • XML示例
  • JSON示例
1
2
3
4
5
6
<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

返回
顶部