クイックスタート — サーバーから API を呼び出します
サンドボックスを取得し、`esk_test_` キーを保存して確認し、テンプレートからドキュメントを作成して送信します。署名セッション トークンは同じキーを使用します。 Webhookは管理アプリに登録されています。
始める前に
「curl」と「jq」を備えた端末と、あなたが管理する電子メールの受信箱が必要です。サンドボックスのキーは「esk_test_…」です。プロダクションキーは「esk_live_…」です。 「Authorization: Bearer」として送信します。テナントはキーから取得されるため、「x-tenant-id」は送信しないでください。
サンドボックスキーには「integrations:zapier」と「signing:write」が含まれます。サインイン後のアップロード、エンベロープ ウィザード、および webhook 登録では、管理者セッションが使用されます。サーバーは、以下の呼び出しにキーを使用します。
4 回のサーバー呼び出し、その後管理アプリでの webhook
- 1
サンドボックスを請求する
POST /api/auth/register with `mode: sandbox`. The response includes a full `esk_test_…` key, shown once, plus `demoCustomerId`. When seeding succeeds it also includes `sampleTemplateId`.
- 2
キーを確認
GET /api/v1/zapier/auth/test with the key. Expected output: HTTP 200 and `{ success: true, data: { tenantId, tenantName, zapierEnabled: true } }`.
- 3
書類を作成して送信
POST /api/v1/zapier/actions/create-from-template with `sampleTemplateId`, then POST /api/v1/zapier/actions/send-for-signing with the returned `documentId`. The signer receives the link by email.
- 4
管理者にwebhookを登録します
サインインして、「管理者」→「開発者」→「P1」を開きます。署名シークレットを保存します。配送は`X-Endorsed-Signature`を使用します。検証手順は、webhook のガイドに記載されています。 「管理者」→「開発者」→「コンソール」で試行を検査します。
ステップ 1 — サンドボックスを要求する
前提条件: 電子メール アドレスと 8 文字以上のパスワード。予想される出力: `esk_test_` を開始する `data.sandbox.apiKey` を含む HTTP 201。
curl -sS -X POST https://api.endorsedsign.com/api/auth/register \
-H 'Content-Type: application/json' \
-d '{
"tenantName": "Acme Dev Sandbox",
"adminEmail": "you@acme.example",
"password": "your-strong-password",
"mode": "sandbox"
}' | tee sandbox.json | jq '.data.sandbox'
# → {
# "apiKey": "esk_test_…",
# "keyPrefix": "esk_test_…",
# "keyId": "…",
# "scopes": ["signing:write", "integrations:zapier", …],
# "demoCustomerId": "sandbox-signer-acme-dev-sandbox",
# "demoCustomerName": "Sandbox Signer",
# "sampleTemplateId": "…",
# "expiresAt": "2026-…"
# }
export ENDORSED_API_KEY="$(jq -r '.data.sandbox.apiKey' sandbox.json)"
export ENDORSED_TEMPLATE_ID="$(jq -r '.data.sandbox.sampleTemplateId // empty' sandbox.json)"サーバーのシークレットマネージャーにキーを保存します。電子メール認証により、管理コンソールにアクセスできなくなります。キーは、発行されるとすぐにこのページの呼び出しに対して機能します。
ステップ 2 — キーを確認する
前提条件: ステップ 1 の `$ENDORSED_API_KEY`。サンドボックス キーにはすでに `integrations:zapier` があります。予想される出力: HTTP 200 とテナント名。
curl -sS https://api.endorsedsign.com/api/v1/zapier/auth/test \
-H "Authorization: Bearer $ENDORSED_API_KEY" \
| jq '{ success, tenantId: .data.tenantId, tenantName: .data.tenantName, zapierEnabled: .data.zapierEnabled }'欠落または不正なキーは 401 です。`integrations:zapier` のない有効なキーは 403 です。`X-Data-Mode` を送信しないでください: `esk_test_` はすでにテスト データを選択しています。
ステップ 3 — サンドボックス テンプレートからドキュメントを作成して送信します
前提条件: `$ENDORSED_API_KEY` および空ではない `$ENDORSED_TEMPLATE_ID`。 `sampleTemplateId` が null の場合は、管理アプリでテンプレートを作成し、その ID を貼り付けます。予期される出力: `data.documentId` を含む HTTP 201、その後 `status: "link-sent"` を含む送信応答。
curl -sS -X POST https://api.endorsedsign.com/api/v1/zapier/actions/create-from-template \
-H "Authorization: Bearer $ENDORSED_API_KEY" \
-H 'Content-Type: application/json' \
-d "{
\"templateId\": \"$ENDORSED_TEMPLATE_ID\",
\"recipientEmail\": \"you@acme.example\",
\"recipientName\": \"Sandbox Signer\"
}" | tee created.json | jq '.data | { documentId, customerId, status }'
export ENDORSED_DOCUMENT_ID="$(jq -r '.data.documentId' created.json)"
curl -sS -X POST https://api.endorsedsign.com/api/v1/zapier/actions/send-for-signing \
-H "Authorization: Bearer $ENDORSED_API_KEY" \
-H 'Content-Type: application/json' \
-d "{
\"documentId\": \"$ENDORSED_DOCUMENT_ID\",
\"channel\": \"email\",
\"subject\": \"Please sign\"
}" | jq '.data | { documentId, status, channel, shareLinkExpiresAt }'署名リンクは「recipientEmail」に電子メールで送信されます。 JSON 応答には、ドキュメント ID、ステータス、リンクの有効期限が含まれます。電子メールを開いて署名を完了し、管理者に登録した webhook の `document.signed` を確認します。
署名セッショントークンを作成する
前提条件: `$ENDORSED_API_KEY` と `signing:write` (サンドボックス キーに含まれています) およびすでに作成したセッションの署名セッション ID。予期される出力: ワンタイム `st_…` トークンを含む HTTP 201。
curl -sS -X POST "https://api.endorsedsign.com/api/v1/signing-sessions/$ENDORSED_SESSION_ID/tokens" \
-H "Authorization: Bearer $ENDORSED_API_KEY" \
-H 'Content-Type: application/json' \
-d '{ "scope": "embed", "ttl_seconds": 300 }' \
| jq '{ token, expires_at, scope }'ブラウザの埋め込みに「st_…」を渡します。 `esk_…` をサーバー上に保持します。引き換え手順は、Elements embed ページに記載されています。