완료된 서명 문서를 API로 다운로드하는 방법은?

완료된 서명 문서를 API로 다운로드하는 방법을 안내드립니다.

문서 다운로드 API

# 1. 완료 문서 목록 조회
GET https://api.pactery.com/v1/requests/{requestId}

# 2. 완료된 PDF 다운로드
GET https://api.pactery.com/v1/requests/{requestId}/download

Node.js 예시

// 서명 완료 확인
const req = await fetch(`https://api.pactery.com/v1/requests/${requestId}`, {
  headers: { Authorization: `Bearer ${apiKey}` }
})
const data = await req.json()

if (data.status === 'completed') {
  // PDF 다운로드
  const pdf = await fetch(`https://api.pactery.com/v1/requests/${requestId}/download`, {
    headers: { Authorization: `Bearer ${apiKey}` }
  })
  const buffer = await pdf.arrayBuffer()
  fs.writeFileSync('signed_doc.pdf', Buffer.from(buffer))
}

감사 추적 인증서 다운로드

GET https://api.pactery.com/v1/requests/{requestId}/audit-trail