# 문서 다운로드 견적



현재 내용의 DOCX 다운로드 가격과 무료 재다운로드 여부를 확인합니다.



인증: Authorization: Bearer $APICK_API_KEY

요청 본문: application/json. 문서 JSON과 숫자 버전을 그대로 전달합니다.

인증키는 서버에 보관하세요. 모든 예제는 정적 자료입니다.



## POST /rest/document_quote 응답 필드

## API 요청: POST /rest/document_quote



### 입력

- `document_id` (string, 필수): 내 문서 ID 문자열로 보내며, 빼거나 빈 값으로 보내면 요청이 거부됩니다.

- `version` (integer, 필수): 요청한 제품의 세대·버전입니다. 버전에 따라 지원 길이·해상도·가격이 다릅니다.



### 응답 명세

```json

{
  "type": "object",
  "properties": {}
}

```

### curl

```curl

curl --fail-with-body --request POST "https://apick.app/rest/document_quote" \
  --header "Authorization: Bearer $APICK_API_KEY" \
  --header "Content-Type: application/json" \
  --data-binary @document-request.json
# document-request.json에 아래 JSON을 저장하고 요청 ID와 문서 식별자를 바꿉니다.
# {"document_id":"YOUR_DOCUMENT_ID","version":1}

```

### Node.js (서버 ESM)

```javascript

const body = {
  "document_id": "YOUR_DOCUMENT_ID",
  "version": 1
};
const response = await fetch("https://apick.app/rest/document_quote", {
  method: "POST",
  headers: { Authorization: "Bearer " + process.env.APICK_API_KEY, "Content-Type": "application/json" },
  body: JSON.stringify(body), signal: AbortSignal.timeout(120_000)
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());

```

### python

```python

import os, json, requests
body = json.loads("{\"document_id\":\"YOUR_DOCUMENT_ID\",\"version\":1}")
response = requests.post("https://apick.app/rest/document_quote", json=body, headers={"Authorization": "Bearer " + os.environ["APICK_API_KEY"]}, timeout=120)
response.raise_for_status()
print(response.json())

```

### php

```php

<?php
$body = json_decode('{"document_id":"YOUR_DOCUMENT_ID","version":1}', true);
$curl = curl_init("https://apick.app/rest/document_quote");
curl_setopt_array($curl, [CURLOPT_POST => true, CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("APICK_API_KEY"), "Content-Type: application/json"], CURLOPT_POSTFIELDS => json_encode($body), CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 120]);
$result = curl_exec($curl);
if ($result === false || curl_getinfo($curl, CURLINFO_HTTP_CODE) >= 400) throw new RuntimeException("문서 요청 실패");
curl_close($curl);
echo $result;

```

## 코드·오류

### 업무 실패 응답

입력 오류·대상 없음·일시 실패는 data.error(사유)와 data.success=0으로 오며 api.cost는 0(과금 없음)입니다. HTTP 상태는 400·404·408·424 중 하나입니다. 입력 오류는 값을 고쳐 다시 요청하고, 408·424는 잠시 후 한 번 다시 시도하세요.

```json

{
  "data": {
    "error": "입력값을 확인해 주세요.",
    "success": 0
  },
  "api": {
    "success": true,
    "cost": 0,
    "ms": 5
  }
}

```

## 상세 기능·요금

문서 작성 순서document_create로 문서를 만들고 document_get으로 엽니다. 편집 후 document_update에 현재 version을 넣어 저장합니다. document_quote의 version과 content_hash를 document_download에 전달하면 DOCX를 받습니다. 수정 충돌은 409로 알려 줍니다.문서 JSON 예: {"type":"doc","content":[{"type":"paragraph","content":[{"type":"text","text":"회의 내용"}]}]}문단(paragraph), 제목(heading), 표(table), 목록(bulletList·orderedList), 텍스트(text), 서명(image), 페이지 나누기(pageBreak)를 지원합니다. 굵게(bold), 기울임(italic), 밑줄(underline), 글꼴·크기·색상(textStyle)을 지정할 수 있습니다. 본문은 100,000자, 이미지 6개까지이며 서명은 PNG·JPEG data URL 각 300KB 이하입니다. 가격과 보관무료. 저장·열기·목록·수정·삭제·견적은 무료입니다. 공개 API AI 작성은 성공당 20P이며 웹의 하루 20회 무료 체험과 별도입니다. DOCX 다운로드는 최초 100P이며 같은 문서에서 구매한 내용은 무료로 다시 받습니다. 내용이 바뀌면 새로운 다운로드 가격을 확인해 주세요.문서는 최초 저장 또는 마지막 수정·다운로드 후 14일간 보관합니다. 열기와 변경 없는 저장은 기한을 연장하지 않습니다. 기한이 지나면 문서와 파일이 삭제됩니다. 본인 문서만 사용할 수 있으며 없는 문서·만료 문서는 404, 잔액 부족은 402로 알려 줍니다. 실패한 AI 작업과 파일 생성은 차감하지 않습니다.

## 상세 요청

POST https://apick.app/rest/document_quote · JSON · Authorization: Bearer 인증키
