上传文件到沙盒
请求头(Request Header)
请参考API 使用指南
请求参数(Request Parameters)
| 名称 | 类型 | 必须 | 位置 | 描述 |
|---|---|---|---|---|
| workspace_id | string | 是 | path | 工作空间 ID |
| sandbox_id | string | 是 | path | 沙盒 ID |
| file_name | string | 是 | body | 文件名 |
| target_path | string | 是 | body | 目标路径 |
| file_content | bytes | 是 | 文件内容(Base64 编码),文件大小不超过50M |
请求示例(Request Example)
curl -L -X POST 'https://sandbox.cn-sh-01.sensecoreapi.cn/studio/sandbox/v1/workspaces/01993ca4-edfa-7382-8161-43a4919681ab/sandboxes/c8e381e5-491c-47cf-842b-aacf914a8c35:execute' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data '{
"file_name":"test.png",
"target_path":"/data/test",
"file_content": "aGVsbG8gd29ybGTvvIHvvIHvvIE="
}'
响应(Response)
异常情况请参考异常响应说明
| 字段 | 类型 | 描述 |
|---|---|---|
| file_path | string | 已上传文件路径 |
响应示例(Response Example)
- 正常响应
{
"file_path": "/data/test/test.png"
}