公开 API v1
将电子签名集成到您的技术栈
发送信封、跟踪签名、接收 webhooks。简单的 REST API、OpenAPI 3.0、curl/Node/Python 示例 — 所有内容都可在数小时内将 Certyneo 连接到您的 HRIS、CRM 或业务软件。
快速开始
三个步骤:从参数设置中创建 API 密钥,将您的 PDF 编码为 base64,然后发送。响应包含 `signUrl`,您可以直接与收件人分享。
cURLbash
# 1. Upload the PDF (multipart) and capture the returned document id.
DOC_ID=$(curl -s -X POST https://certyneo.com/api/v1/documents \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
-F "file=@contrat.pdf" | jq -r .id)
# 2. Create a DRAFT envelope referencing the uploaded document.
ENV_ID=$(curl -s -X POST https://certyneo.com/api/v1/envelopes \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d "{
\"subject\": \"Contrat de prestation\",
\"documentIds\": [\"$DOC_ID\"],
\"recipients\": [
{ \"email\": \"client@example.com\", \"name\": \"Marie Dubois\", \"role\": \"SIGNER\" }
]
}" | jq -r .id)
# 3. Dispatch the envelope — this sends the invitation email/SMS.
curl -X POST https://certyneo.com/api/v1/envelopes/$ENV_ID/send \
-H "Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx"JavaScript / Nodets
// npm install @certyneo/sdk (or call fetch directly)
const auth = { Authorization: `Bearer ${process.env.CERTYNEO_API_KEY}` };
// 1. Upload the PDF (multipart).
const fd = new FormData();
fd.append("file", new Blob([pdfBuffer], { type: "application/pdf" }), "contrat.pdf");
const doc = await fetch("https://certyneo.com/api/v1/documents", {
method: "POST", headers: auth, body: fd,
}).then((r) => r.json());
// 2. Create the DRAFT envelope.
const envelope = await fetch("https://certyneo.com/api/v1/envelopes", {
method: "POST",
headers: { ...auth, "Content-Type": "application/json" },
body: JSON.stringify({
subject: "Contrat de prestation",
documentIds: [doc.id],
recipients: [
{ email: "client@example.com", name: "Marie Dubois", role: "SIGNER" },
],
}),
}).then((r) => r.json());
// 3. Dispatch — this triggers the invitation channel for every recipient.
await fetch(`https://certyneo.com/api/v1/envelopes/${envelope.id}/send`, {
method: "POST", headers: auth,
});
console.log(envelope.id);Pythonpython
import os, requests
auth = {"Authorization": f"Bearer {os.environ['CERTYNEO_API_KEY']}"}
# 1. Upload the PDF (multipart).
with open("contrat.pdf", "rb") as f:
doc = requests.post(
"https://certyneo.com/api/v1/documents",
headers=auth,
files={"file": ("contrat.pdf", f, "application/pdf")},
).json()
# 2. Create the DRAFT envelope.
envelope = requests.post(
"https://certyneo.com/api/v1/envelopes",
headers={**auth, "Content-Type": "application/json"},
json={
"subject": "Contrat de prestation",
"documentIds": [doc["id"]],
"recipients": [
{"email": "client@example.com", "name": "Marie Dubois", "role": "SIGNER"},
],
},
).json()
# 3. Dispatch — this triggers the invitation channel for every recipient.
requests.post(
f"https://certyneo.com/api/v1/envelopes/{envelope['id']}/send",
headers=auth,
)
print(envelope["id"])信封
创建、发送、状态跟踪、取消。一个信封可以包含多个文档和多个签署人(并行或顺序)。
网络钩子
在您选择的 URL 上接收 `envelope.created`、`envelope.completed`、`envelope.declined`。每个负载都使用 HMAC SHA-256 验证来源。
简单身份验证
Bearer 令牌。每个环境一个密钥(测试/生产)。可以立即撤销。限制为每个密钥每分钟 100 个请求,突发 200 个,干净的 429 响应带有 Retry-After 标头。
可用端点
12 条路由覆盖完整周期:信封、文档、webhooks、API 密钥。所有路由接受 Bearer 令牌并返回 JSON。
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/documents | Upload a PDF (multipart) — returns document id |
| GET | /api/v1/documents | List documents |
| GET | /api/v1/documents/{id} | Fetch document metadata |
| DELETE | /api/v1/documents/{id} | Delete document |
| GET | /api/v1/envelopes | List envelopes |
| POST | /api/v1/envelopes | Create envelope (status: DRAFT) |
| GET | /api/v1/envelopes/{id} | Fetch envelope state |
| PATCH | /api/v1/envelopes/{id} | Update DRAFT envelope |
| DELETE | /api/v1/envelopes/{id} | Void / delete DRAFT envelope |
| POST | /api/v1/envelopes/{id}/send | Dispatch DRAFT — sends invitations |
| GET | /api/v1/envelopes/{id}/audit-trail | Download eIDAS audit-trail PDF |
| GET | /api/v1/envelopes/{id}/signed-document | Download signed PDF (once COMPLETED) |
| GET | /api/v1/webhooks | List webhooks |
| POST | /api/v1/webhooks | Register webhook |
| DELETE | /api/v1/webhooks/{id} | Unregister |
| GET | /api/v1/keys | List API keys |
| POST | /api/v1/keys | Create API key |
| DELETE | /api/v1/keys/{id} | Revoke key |
速率限制
速率限制保证所有客户的服务质量稳定。如果您需要更多,请联系我们。
- • 每个 API 密钥每分钟 100 个请求
- • 允许突发到 10 秒内的 200 个请求
- • 429 响应,带有指示延迟秒数的 Retry-After 标头