사진을 URL로 로고

API 문서

API는 유효한 Pro 또는 Premium 구독이 필요합니다. API 키로 인증하면 대시보드와 같은 라이브러리에 이미지를 올릴 수 있습니다. 한도는 웹사이트의 유료 요금제와 같습니다.

상품 이미지

이미지 업로드

POST /api/v1/upload (multipart/form-data).

매개변수

Authorization
필수. 요청 헤더. 형식: Bearer 당신의_API_키.
file
필수. 바이너리 파일 또는 base64 데이터.
name
선택. 파일 이름. 로컬 파일을 multipart로 올리면 자동 인식됩니다.

요청 예시

바이너리 파일

curl https://phototourl.com/api/v1/upload \
  -X POST \
  -H "Authorization: Bearer ptu_live_YOUR_KEY" \
  -F "file=@./product.jpg"

Base64

curl https://phototourl.com/api/v1/upload \
  -X POST \
  -H "Authorization: Bearer ptu_live_YOUR_KEY" \
  -F "file=R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" \
  -F "name=pixel.gif"

로컬 파일 업로드는 항상 POST를 사용하세요. GET 업로드는 지원하지 않습니다.

응답 필드

id
라이브러리의 리소스 id.
url
상품 페이지에 쓸 수 있는 CDN URL.
fileName
원본 파일 이름.
fileSize
파일 크기(바이트).
mimeType
업로드된 파일의 MIME 유형.
createdAt
UTC 업로드 시각. 형식 YYYY-MM-DD HH:mm:ss.
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "url": "https://cdn.phototourl.com/pro/2026-11-05-a1b2c3d4-e5f6-7890-abcd-ef1234567890.jpg",
  "fileName": "product.jpg",
  "fileSize": 128472,
  "mimeType": "image/jpeg",
  "createdAt": "2026-11-05 10:20:30"
}

이미지 목록

GET /api/v1/images. 선택적으로 page와 pageSize(최대 100).

curl "https://phototourl.com/api/v1/images?page=1&pageSize=20" \
  -H "Authorization: Bearer ptu_live_YOUR_KEY"

응답 필드

resources
이미지 배열: id, fileName, url, fileSize, mimeType, createdAt.
page
현재 페이지 번호.
pageSize
페이지당 항목 수.
total
라이브러리 이미지 총개수.
{
  "resources": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "fileName": "product.jpg",
      "url": "https://cdn.phototourl.com/pro/2026-11-05-a1b2c3d4-e5f6-7890-abcd-ef1234567890.jpg",
      "fileSize": 128472,
      "mimeType": "image/jpeg",
      "createdAt": "2026-11-05 10:20:30"
    }
  ],
  "page": 1,
  "pageSize": 20,
  "total": 1
}

이미지 삭제

DELETE /api/v1/images/:id. 스토리지와 라이브러리에서 파일을 제거합니다.

curl -X DELETE https://phototourl.com/api/v1/images/RESOURCE_ID \
  -H "Authorization: Bearer ptu_live_YOUR_KEY"

응답 필드

success
삭제 성공 시 true.
{ "success": true }

한도

무료에서는 API를 쓸 수 없습니다. Pro / Premium은 요금제의 업로드·저장·파일 크기 한도를 따릅니다. 초과 시 upgradeUrl이 포함된 오류가 반환될 수 있습니다.

오류

실패한 요청은 오류 코드를 반환합니다. 한도 오류에는 upgradeUrl이 포함될 수 있습니다.

  • dailyLimitReached— 일일 업로드 한도에 도달했습니다(HTTP 429).
  • storageLimitReached— 저장 용량을 초과했습니다(HTTP 413).
  • fileTooLarge— 요금제에서 허용하는 파일 크기보다 큽니다(HTTP 400).
  • 401— API 키가 없거나 잘못되었거나 폐기되었습니다.
{
  "error": "dailyLimitReached",
  "errorParams": { "limit": 1000 },
  "plan": "paid",
  "limit": 1000,
  "upgradeUrl": "https://www.phototourl.com/pricing"
}