更新时间:2024-03-26 GMT+08:00
分享

媒体文件下载

消息用途

SP业务应用向5G消息云服务获取文件。

方法

  • HTTPS GET
  • URL: https://{serverRoot}/v2/{chatbotAddress}/files
  • Basepath: openchatbot

消息关键参数

请求消息头关键参数:

序号

字段

数据类型

可选属性

描述

1

File-Location

String

M

上行消息中待下载文件的URL

2

Range

string

C

下载文件范围

断点续传时必须填写此参数

响应消息参数:

序号

字段

数据类型

可选属性

描述

1

响应码

string

M

200/206:成功,请求中有“Range: bytes”时返回206,否则返回200

404/410:文件不存在/过期

2

Content-Range

String

O

文件范围

3

<file content>

string

O

文件内容

请求消息示例

GET /openchatbot/v2/123456/files HTTP/1.1
Authorization: Username="a20a9716-8577-4e5e-8333-490df5b72e9f", Password=“******”
Accept: */*
Host: 10.186.76.175:8323
accept-encoding: gzip, deflate
Connection: keep-alive

响应消息示例

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Disposition: form-data; name="File"; filename="1.jpg"
Content-Type: image/jpeg
Content-Transfer-Encoding: 8bit
DATE: Tue, 12 Jul 2016 06:00:00 GMT
Content-Range: bytes 0-123455/123456
Content-Length: 123456
分享:

    相关文档

    相关产品