presign_team_upload_parts
POST
/api/v1/teams/{team_id}/files/upload/{upload_id}/presign-parts
const url = 'https://example.com/api/v1/teams/1/files/upload/example/presign-parts';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"part_numbers":[1]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/teams/1/files/upload/example/presign-parts";
let payload = json!({"part_numbers": (1)});
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/json".parse().unwrap());
let client = reqwest::Client::new(); let response = client.post(url) .headers(headers) .json(&payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request POST \ --url https://example.com/api/v1/teams/1/files/upload/example/presign-parts \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "part_numbers": [ 1 ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”team_id
required
integer format: int64
Team ID
upload_id
required
string
Upload session ID
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
Request complete presigned PUT descriptors for multipart upload parts.
object
part_numbers
required
Array<integer>
Examplegenerated
{ "part_numbers": [ 1 ]}Responses
Section titled “Responses”Presigned requests
Media typeapplication/json
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
code
required
string
data
object
key
additional properties
Complete browser request descriptor returned by a presigning driver.
The driver that creates the signature owns both the URL and every request header required to make that signature valid. Browser adapters must forward this descriptor without inventing provider-specific headers.
object
headers
签名时纳入请求契约的 headers;浏览器必须原样转发,不能自行补充。
object
key
additional properties
string
url
required
完整签名请求的目标 URL。
string
error
msg
required
string
Example
{ "code": "success"}Unauthorized
Forbidden
Session not found