파일 다운로드

발급된 토큰을 이용해 파일을 다운로드할 수 있습니다. 발급된 토큰은 1회만 사용 가능하며, 30분 후 만료됩니다.

HTTP 요청

GET /downloader
cURL 예시
curl -H "Authorization: Bearer <API_KEY>" \
    "https://HOSTNAME/downloader?token=4ba40c97-b31b-450f-8af8-ceb1b94f5514&force_download=true"
요청 매개변수
필수타입설명비고
tokenO문자열다운로드 토큰 GUID36자 GUID (예: 4ba40c97-b31b-450f-8af8-ceb1b94f5514)
force_downloadX불리언파일 다운로드 강제 여부true: 바로 다운로드, false: 브라우저 미리보기 시도

정상 응답

HTTP 상태 코드 200과 함께 파일 내용을 응답

응답 헤더
헤더설명
Content-Type파일 확장자에 따른 MIME 타입
Content-Dispositionattachment (직접 다운로드) 또는 inline (브라우저 미리보기)
Transfer-Encodingchunked (청크 단위 전송)

응답 본문은 요청된 파일의 이진 데이터입니다.

오류 응답

토큰이 없거나 유효하지 않은 경우

HTTP 상태 코드 403 응답

{
  "error_code": "token-not-found",
  "error_msg": "download token not found or expired"
}
서버 내부 오류로 파일 다운로드가 불가능한 경우

HTTP 상태 코드 500 응답

{
  "error_code": "file-download-error",
  "error_msg": "internal server error occurred during file download"
}