SaaS API제출 링크 (매직 링크)
POST /submit-link/{token}/signed-url
GCS Resumable Signed URL 발급 (무인증)
GCS Resumable Signed URL 발급
브라우저가 GCS로 파일을 직접 업로드할 수 있는 Resumable(재개 가능) Signed URL을 발급합니다. 파일은 서버를 거치지 않으므로 대용량/불안정 네트워크에서도 안정적으로 업로드됩니다.
브라우저 업로드 2단계
- 발급받은
uploadUrl로POST(헤더x-goog-resumable: start,Content-Type: {contentType}) → 응답Location헤더에 세션 URI가 옵니다. - 세션 URI로 파일 바이트를
PUT. 업로드 중 끊기면Range헤더로 끊긴 지점부터 재개합니다.
업로드가 끝나면 publicUrl을 완료 콜백의 filePath(또는 cleanFilePath/finalFilePath)로 전달합니다.
HTTP 요청
POST /submit-link/{token}/signed-url
Content-Type: application/jsonPath Parameters
| 파라미터 | 타입 | 필수 | 설명 |
|---|---|---|---|
token | string | 예 | 제출 링크 토큰 |
Request Body
{
"filename": "video.mp4",
"contentType": "video/mp4"
}| 필드명 | 타입 | 필수 | 설명 |
|---|---|---|---|
filename | string | 예 | 원본 파일명 |
contentType | string | 예 | 브라우저 file.type (예: video/mp4) |
허용 Content-Type: image/*, video/*, 그리고 압축 파일
(application/zip, application/x-tar, application/gzip, application/vnd.rar, application/x-7z-compressed)
응답
성공 응답 (200 OK)
{
"status": 200,
"code": null,
"message": "발급 완료",
"data": {
"uploadUrl": "https://storage.googleapis.com/glowb-input/...&X-Goog-Signature=...",
"publicUrl": "https://storage.googleapis.com/glowb-input/campaign/content/link/100/1733900000000_video.mp4"
}
}| 필드명 | 타입 | 설명 |
|---|---|---|
uploadUrl | string | 브라우저가 POST(resumable start)할 서명 URL (만료 30분) |
publicUrl | string | 업로드 완료 후 제출에 사용할 GCS URL |
에러 응답
| 상황 | 상태 코드 | 메시지 |
|---|---|---|
| 토큰 만료/사용됨 | 400 | 만료되었거나 사용할 수 없는 링크입니다. |
| Content-Type 누락 | 400 | Content-Type이 필요합니다. |
| 미지원 형식 | 400 | 지원하지 않는 파일 형식입니다: {contentType} |
| 발급 실패 | 500 | 업로드 URL 발급에 실패했습니다. |