跳轉到主要內容
POST
Upload reference asset
請使用正式環境的 DGrid Model API Key。若已有符合規格且伺服器可存取的 HTTPS 網址,可略過上傳。

上傳檔案

以 multipart 的 file 欄位傳送一個圖片或影片檔。伺服器會從檔案內容辨識類型。請讓 cURL 或 HTTP 用戶端自動產生 multipart boundary。
對外閘道可能設定較小的請求大小上限。檔案仍須符合模型的尺寸、長度、影格率和輸入組合等要求。

上傳並送審

將選用的查詢參數 submit_for_review 設為單一 true 即可送審。省略此參數或傳入 false 時僅上傳。送審影片須在上傳時即可讀取長度。
HTTP 201 表示上傳成功。送審時也會回傳 asset_id,可用來查詢審核結果。
若簽名網址已過期,可重新上傳以取得新網址,或依建立影片的說明引用仍為 Active 的素材 ID。

查詢審核狀態

使用同一 DGrid 使用者的憑證呼叫 GET /v1/video-assets/{asset_id},並填入上傳回應中的 asset_id。此請求無須提供內容。
狀態值區分大小寫。若遇到無法辨識的狀態,請保留素材 ID 並查明原因。本機等待逾時後,可用同一 ID 恢復輪詢。

上傳與審核錯誤

409 video_asset_submission_unconfirmed 表示同一素材正在送審,或上游受理結果未明。若有 asset_id,請直接查詢。若無 ID,請等待後用同一個檔案重試送審。若錯誤持續,請聯絡 DGrid 支援。影片生成的冪等鍵僅適用於建立影片的請求。

授權

Authorization
string
header
必填

Your DGrid API key. All endpoints use Authorization: Bearer <DGRID_API_KEY>.

查詢參數

submit_for_review
boolean
預設值:false

Set to true to submit the file for review as part of the upload.

主體

multipart/form-data
file
file
必填

Reference image or video file.

回應

Reference asset uploaded.

url
string<uri>

Signed HTTPS URL valid for 24 hours after issuance.

expires_at
string<date-time>

RFC 3339 timestamp when the signed URL expires.

content_type
string

MIME type detected from the file.

size_bytes
integer

File size in bytes.

width
integer

Detected width in pixels, when available.

height
integer

Detected height in pixels, when available.

duration_seconds
string

Video duration in seconds as a decimal string, when available.

fps
string

Average video frame rate as a decimal string, when available.

asset_id
string

Official asset ID returned when the file is submitted for review.