SignSpry REST API v1
기본 URL https://signspry.com/api/v1 · JSON 입력, JSON 출력 · 오류 시 4xx/5xx와 함께 {"error": "…"} 반환.
인증
개발자 콘솔에서 키를 만들어 모든 요청에 포함하세요:
curl https://signspry.com/api/v1/account \ -H "Authorization: Bearer sk_live_YOUR_KEY"
키에는 생성 시 선택한 범위만 부여됩니다 — envelopes:read(목록, 상태, 감사 추적, 봉인된 PDF), envelopes:write(생성, 발송, 알림, 무효화, 서명 및 임베드 링크), templates:read, account:read. 키의 범위를 벗어난 호출은 누락된 범위를 명시한 403을 반환합니다. 키는 만료되며(30일, 90일, 1년 또는 무기한 — 1주일 전에 이메일로 알림) 이후에는 401을 반환합니다. 또한 IP 허용 목록(주소 또는 CIDR 범위)으로 고정할 수 있으며, 그 외 위치에서는 403을 반환합니다. 통합마다 필요한 최소 범위의 키를 따로 발급하면, 하나를 취소해도 다른 통합에 영향을 주지 않습니다.
봉투 생성 & 발송
한 번의 호출로 문서(base64 PDF)를 업로드하고, 수신자와 필드를 추가하고, 발송합니다. 좌표는 왼쪽 위 기준 페이지 비율(0–1)이며, recipient는 recipients 배열의 인덱스입니다. status: "sent"는 초대 이메일을 즉시 보냅니다(생략하면 초안으로 유지).
curl -X POST https://signspry.com/api/v1/envelopes \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Service Agreement",
"message": "Please sign by Friday.",
"expires_days": 15,
"reminder_days": 2,
"status": "sent",
"documents": [{"name": "agreement.pdf", "content_b64": "'"$(base64 -w0 agreement.pdf)"'"}],
"recipients": [
{"name": "Asha Vendor", "email": "asha@vendor.in", "routing_order": 1,
"phone": "+919876543210", "notify": "whatsapp"},
{"name": "Manu Shekhar", "email": "manu@signspry.com", "routing_order": 2},
{"name": "Accounts", "email": "accounts@signspry.com", "role": "cc"}
],
"fields": [
{"recipient": 0, "type": "signature", "page": 0, "x": 0.10, "y": 0.72, "w": 0.25, "h": 0.05},
{"recipient": 0, "type": "text", "page": 0, "x": 0.10, "y": 0.60, "w": 0.20, "h": 0.04,
"label": "PAN", "validation": {"type": "pan"}},
{"recipient": 1, "type": "signature", "page": 1, "x": 0.10, "y": 0.72, "w": 0.25, "h": 0.05}
]
}'
필드 유형: signature initials text date checkbox dropdown(options 포함) radio(group_name 포함) formula. 유효성 검사: email numbers letters date phone_in pincode pan gstin {"type":"custom","regex":"…"}.
수신자에게 phone(국가 코드 포함, 예: +447700900123)과 notify: "whatsapp" 또는 "sms"를 지정할 수도 있습니다. 그러면 초대, 알림, 완료된 사본이 이메일과 함께 해당 채널로도 발송됩니다. 이 설치에서 켜져 있지 않은 채널이나 국가 코드가 없는 번호는 400을 반환합니다. 인도 번호로의 SMS는 설치의 DLT 등록이 완료된 후 발송되며, 그 전까지 해당 수신자는 이메일(선택한 경우 WhatsApp 포함)을 받습니다.
verify: "email", "whatsapp" 또는 "sms"는 문서가 열리기 전에 수신자의 이메일 주소나 휴대폰으로 보낸 6자리 일회용 코드를 요구합니다(WhatsApp과 SMS는 phone 필요). 인증 내역은 감사 추적과 완료 증명서에 기록됩니다.
임베디드 서명
이메일 초대 대신(또는 함께) 서명 URL을 받아 자체 앱에서 iframe이나 리디렉션으로 여세요. 서명자가 완료하면 ?envelope=…&event=signed(또는 declined)와 함께 return_url로 이동합니다.
curl -X POST https://signspry.com/api/v1/envelopes/ENV_ID/recipients/RECIPIENT_ID/signing-link \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"return_url": "https://yourapp.com/signing-done"}'
# {"url": "https://signspry.com/sign/…", "recipient": {…}}
수신자 ID는 생성/상세 응답에서 가져옵니다. 호출할 때마다 새 링크가 발급되고 해당 수신자의 이전 링크는 무효화됩니다. 라우팅 순서는 그대로 적용되며, 차례가 아닌 서명자에게는 "다른 사람 대기 중" 페이지가 표시됩니다.
웹훅
콘솔에서 엔드포인트를 추가하면, 일치하는 모든 이벤트가 JSON으로 POST됩니다:
POST https://yourapp.com/webhooks/signet
X-Signet-Event: envelope.completed
X-Signet-Signature: sha256=<hex HMAC-SHA256 of raw body, keyed with your whsec_… secret>
{"id":"…","event":"envelope.completed","created_at":1787480000.1,
"data":{"envelope":{"id":"…","title":"…","status":"completed","recipients":[…]}}}
검증(Python): hmac.new(secret, raw_body, hashlib.sha256).hexdigest() == header.split("sha256=")[1]. 실패한 전송은 두 번 재시도되며, 최근 전송 결과는 콘솔에 표시됩니다. 이벤트: envelope.sent recipient.viewed recipient.signed recipient.declined recipient.reassigned envelope.completed envelope.voided envelope.expired reminder.sent recipient.helper_added recipient.helper_answered
참조
| 엔드포인트 | 기능 |
|---|---|
| GET /account | 키 소유자 + 사용량. |
| POST /envelopes | 봉투 생성(선택적으로 발송). |
| GET /envelopes?status=&limit=&offset= | 봉투 목록 조회. |
| GET /envelopes/:id | 수신자 + 필드를 포함한 전체 상세 정보. |
| POST /envelopes/:id/send | 초안 발송. |
| POST /envelopes/:id/void | 사유와 함께 무효화. |
| POST /envelopes/:id/remind | 대기 중인 서명자에게 이메일로 알림. |
| POST /envelopes/:id/recipients/:rid/signing-link | 임베디드 서명 URL(+ return_url). |
| GET /envelopes/:id/document | 봉인된 서명 PDF 다운로드. |
| GET /envelopes/:id/audit | 해시 체인 감사 추적(JSON). |