5분 만에 첫 서명 요청 보내기
테스트 키 하나면 5분 안에 첫 서명 요청을 보낼 수 있습니다.
1. 문서 생성
curl https://api.pactery.com/v1/documents \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"title": "업무 위탁 계약서",
"content": "<h1>업무 위탁 계약서</h1><p>본 계약은 ...</p>"
}'
응답으로 doc_로 시작하는 문서 ID가 옵니다.
{ "id": "doc_8sK2...", "status": "draft", "title": "업무 위탁 계약서" }
2. 서명자 지정
curl https://api.pactery.com/v1/documents/doc_8sK2.../participants \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"name": "홍길동",
"phone": "01012345678",
"role": "signer",
"auth": "sms_pin"
}'
3. 발송
curl https://api.pactery.com/v1/documents/doc_8sK2.../send \
-H "Authorization: Bearer sk_test_..." \
-X POST
문서 상태가 sent로 바뀌고 서명자에게 링크가 전달됩니다.
4. 상태 확인
curl https://api.pactery.com/v1/documents/doc_8sK2... \
-H "Authorization: Bearer sk_test_..."
participants[].status가 signed가 되고, 모두 끝나면 문서 status가 completed가 됩니다. 폴링 대신 웹훅을 쓰면 완료 시점에 즉시 통지받습니다.