接口名称
下载文件(通过文件Key)(Download File By File Key)
接口地址
/api/shipper/v1/file/download
请求方式
POST
接口描述
该接口用于通过文件 Key 下载服务器上的文件。主要用于上传订单失败后,下载包含错误信息的 Excel 文件。
请求头
参数 |
类型 |
必填 |
说明 |
|---|---|---|---|
sessionId |
String |
是 |
登录会话ID |
language |
String |
是 |
语言 |
Content-Type |
String |
是 |
application/json;charset=UTF-8 或 application/x-www-form-urlencoded |
语言取值:
值 |
说明 |
|---|---|
zh_CN |
中文 |
en_US |
英文 |
请求参数
参数 |
类型 |
必填 |
说明 |
|---|---|---|---|
fileKey |
String |
是 |
文件唯一标识Key(通常由上传接口返回) |
参数说明
*fileKey - 文件Key*
- 来源:上传订单接口返回的 `fileId` 字段
- 格式:字符串,如 "abc123xyz"
- 用途:标识服务器上存储的文件
- 时效:文件可能有时效限制
请求示例
*方式一:application/json*
curl 'https://tracking-qa.etowertech.com/api/file/download' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'language: zh_CN' \
-H 'sessionId: vP1l43F_OqvoTUWBcaAtyg' \
--data-raw '{
"fileKey": "abc123xyz"
}'
*方式二:application/x-www-form-urlencoded*
curl 'https://tracking-qa.etowertech.com/api/file/download' \ -H 'language: zh_CN' \ -H 'sessionId: vP1l43F_OqvoTUWBcaAtyg' \ --data-urlencode 'fileKey=abc123xyz'
返回说明
响应类型: application/octet-stream(文件流)
响应头:
参数 |
说明 |
|---|---|
Content-Disposition |
文件名,如:attachment; filename=failed_orders.xlsx |
Content-Type |
文件类型 |
Content-Length |
文件大小 |
返回说明:
- 返回的是文件流(Excel 文件)
- 前端会触发浏览器下载文件
- 下载的文件包含上传失败的订单及错误详情