upload_team_chunk
PUT
/api/v1/teams/{team_id}/files/upload/{upload_id}/{chunk_number}
const url = 'https://example.com/api/v1/teams/1/files/upload/example/1';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'}, body: '[ 1 ]'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use serde_json::json;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://example.com/api/v1/teams/1/files/upload/example/1";
let payload = "[ 1 ]";
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap()); headers.insert("Content-Type", "application/octet-stream".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url) .headers(headers) .body(payload) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request PUT \ --url https://example.com/api/v1/teams/1/files/upload/example/1 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/octet-stream' \ --data '[ 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
chunk_number
required
integer format: int32
Chunk number (0-indexed)
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/octet-stream
Array<integer>
Responses
Section titled “Responses”Chunk uploaded
Media typeapplication/json
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
Example
{ "code": "success"}Unauthorized
Forbidden
Session not found