create_offline_download_task
const url = 'https://example.com/api/v1/tasks/offline-download';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"expected_sha256":"example","filename":"example","target_folder_id":1,"url":"example"}'};
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/tasks/offline-download";
let payload = json!({ "expected_sha256": "example", "filename": "example", "target_folder_id": 1, "url": "example" });
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/tasks/offline-download \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "expected_sha256": "example", "filename": "example", "target_folder_id": 1, "url": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Parameters for creating an offline download task.
object
Optional expected SHA-256 checksum. Values are trimmed, lowercased, and
must be a 64-character hexadecimal string without a 0x prefix, for
example 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef.
Optional target filename. Empty values are ignored; non-empty values
must pass normalize_validate_name, so path separators and unsafe
Windows device names are rejected.
Optional destination folder. None imports into the workspace root.
Source URL validated by parse_and_validate_source_url; only http://
and https:// URLs with a host are accepted. Local or executable
schemes such as file://, javascript:, and data: are rejected.
Credentials in the URL userinfo component are rejected so they are not
persisted in task payloads; query parameters are accepted, but display
paths are derived through redact_url_for_display.
Examplegenerated
{ "expected_sha256": "example", "filename": "example", "target_folder_id": 1, "url": "example"}Responses
Section titled “Responses”Offline download task created
统一 API 响应格式
成功: { "code": "success", "msg": "", "data": {...} }
失败: { "code": "auth.credentials_failed", "msg": "Invalid Credentials" }
object
object
Lightweight user identity for embedding in admin list/detail responses.
object
object
object
用户头像来源
后台任务类型
object
object
Archive entry filename decoding strategy.
object
object
统一媒体处理器类型(system_config / storage_policy.options)
object
统一媒体处理器类型(system_config / storage_policy.options)
object
object
object
存储驱动类型
object
object
object
object
object
object
object
object
统一媒体处理器类型(system_config / storage_policy.options)
object
统一媒体处理器类型(system_config / storage_policy.options)
object
object
object
object
object
object
Final imported content length in bytes.
Actual engine used for the final successful transfer. Legacy task results may not have this field.
Final SHA-256 digest in lowercase hexadecimal.
Redacted display URL derived from the payload or source URL. This value is always safe to render in task detail views.
object
object
object
Structured diagnostic detail attached to a component report.
object
Stable detail key.
Human-facing text such as a backend, driver, region, or mode.
object
Human-facing text such as a backend, driver, region, or mode.
Signed integer value.
object
Signed integer value.
Unsigned counter or depth value.
object
Unsigned counter or depth value.
Boolean flag.
object
Boolean flag.
Duration value in milliseconds for latency, age, lag, or timeout diagnostics.
object
Duration value in milliseconds for latency, age, lag, or timeout diagnostics.
后台任务状态
Serialized task step shown in task APIs.
object
Optional detail text.
Step finish time.
Stable step key.
Current progress amount.
Total progress amount.
Step start time.
Current step status.
Human-readable step title.
Example
{ "code": "success", "data": { "creator": { "profile": { "avatar": { "source": "none" } } }, "kind": "archive_extract", "payload": { "kind": "archive_compress" }, "presentation": { "status": { "code": "blob_maintenance_integrity_check_name" }, "title": { "code": "blob_maintenance_integrity_check_name" } }, "result": { "kind": "archive_compress" }, "status": "pending", "steps": [ { "status": "pending" } ] }}Invalid offline download request
Unauthorized