转至元数据结尾
转至元数据起始

接口名称

下载文件

接口地址

/api/shipper/v1/file/download

请求方式

POST

请求头

参数

类型

必填

说明

sessionId

String

登录会话ID

language

String

语言

Content-Type

String

application/json;charset=UTF-8

Accept

String

application/json, text/plain, /

语言取值:

说明

zh_CN

中文

en_US

英文

请求参数

参数位置

字段

类型

必填

说明

Query String

fileKey

String

文件Key(需要URL编码)

fileKey 参数说明

fileKey 是文件的唯一标识,查询账单列表返回的fileId。

说明

查询账单列表返回的fileId

账单文件

请求示例

curl 'https://tracking-qa.etowertech.com/api/shipper/v1/file/download?fileKey=bill%2F079842f3-d5d3-4f09-9f96-81c34c9b2fa4.xlsx' \
  -H 'Accept: application/json, text/plain, */*' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  -H 'language: zh_CN' \
  -H 'sessionId: 0HgJ-EO-Sq_ZQ6u93rjMnA' \
  --data-raw '{}'

返回字段说明

成功时直接返回文件流,浏览器会触发下载文件。

响应头说明:

字段

说明

Content-Type

application/octet-stream(二进制文件流)

Content-Disposition

attachment; filename=xxx.xlsx(指定下载文件名)

Access-Control-Expose-Headers

Content-Disposition(允许前端访问文件名)

失败时返回错误信息:

字段

类型

说明

success

Boolean

请求是否成功

code

String

错误状态码

errors

Array

错误信息列表

  • 无标签