檔案
已上傳的檔案、其檢查結果和新的下載連結。工作的結果會隨工作一起提供:請參閱結果與下載。
本頁內容
GET/v1/files/{id}
檔案、其檢查結果,以及上傳完成後的新下載連結。每次呼叫都會提供新的連結,有效期限為 7 天或檔案遭刪除前的剩餘時間,以較短者為準。
路徑參數
idstring必填
回傳
- 200該檔案。
18 個欄位
idstring必填namestring必填operationstring必填上傳時指定的操作。
statestring必填uploading或uploaded其中之一sizeinteger必填created_atstring (date-time)必填uploaded_atstring (date-time)delete_atstring (date-time)刪除時間。有工作正在使用時不會提供。
checkobject上傳完成時對檔案內容所做的檢查。
check.statestring必填proceed:操作可以使用。refuse:無法使用,原因見reason。couldnt_read:檢查無法讀取完整內容;工作會完整讀取。check_failed:我們這邊發生問題;請再次完成上傳以重試。checking、proceed、refuse、couldnt_read或check_failed其中之一check.reasonstringcheck.detailobjectcheck.kindstring檔案的實際類型,例如
video。check.typestring實際格式,例如
mp4,不論檔名怎麼寫。check.factsobject檢查讀取到的資訊,例如影片的長度、尺寸和編解碼器。
check.facts_completebooleandownload_urlstring (URL)只在
GET /v1/files/{id}中提供,且須在上傳完成後。download_expires_atstring (date-time)
錯誤
範例
curl https://api.filesokay.com/v1/files/file_3cf0737aefa34b89b7b4443c9467d60c \
-H "Authorization: Bearer $FILESOKAY_KEY"const res = await fetch("https://api.filesokay.com/v1/files/file_3cf0737aefa34b89b7b4443c9467d60c", {
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
},
});
const file = await res.json();import os
import requests
res = requests.get(
"https://api.filesokay.com/v1/files/file_3cf0737aefa34b89b7b4443c9467d60c",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
)
file = res.json(){
"id": "file_3cf0737aefa34b89b7b4443c9467d60c",
"name": "lecture.mp4",
"operation": "video.compress",
"state": "uploaded",
"size": 12417467,
"created_at": "2026-12-03T09:22:53Z",
"uploaded_at": "2026-12-03T09:23:02Z",
"delete_at": "2026-12-04T09:23:02Z",
"check": {
"state": "proceed",
"kind": "video",
"type": "mp4",
"facts": {
"container": "mp4",
"protection": "none",
"attachments": [],
"duration_ms": 20023,
"frame_count": 600,
"audio_tracks": [
{
"codec": "aac",
"channels": 1,
"sample_rate": 44100
}
],
"video_tracks": [
{
"hdr": "none",
"codec": "h264",
"width": 1280,
"chroma": "420",
"height": 720,
"profile": "High",
"rotation": 0,
"bit_depth": 8,
"frame_rate": 30,
"interlaced": false,
"variable_frame_rate": false
}
],
"data_end_bytes": 12417467,
"subtitle_tracks": []
},
"facts_complete": true
},
"download_url": "https://…",
"download_expires_at": "2026-12-04T09:23:02Z"
}DELETE/v1/files/{id}
立即刪除檔案,也會從儲存空間中刪除。
路徑參數
idstring必填
回傳
- 204已刪除。
錯誤
範例
curl -X DELETE https://api.filesokay.com/v1/files/file_3cf0737aefa34b89b7b4443c9467d60c \
-H "Authorization: Bearer $FILESOKAY_KEY"const res = await fetch("https://api.filesokay.com/v1/files/file_3cf0737aefa34b89b7b4443c9467d60c", {
method: "DELETE",
headers: {
Authorization: `Bearer ${process.env.FILESOKAY_KEY}`,
},
});
console.log(res.status);import os
import requests
res = requests.delete(
"https://api.filesokay.com/v1/files/file_3cf0737aefa34b89b7b4443c9467d60c",
headers={
"Authorization": f"Bearer {os.environ['FILESOKAY_KEY']}",
},
)
print(res.status_code)