This article will walk you through the process of sending a document for signature using the Sign.Plus eSignature API.
按照这些步骤,您将创建一个信封,添加一个文档,设置一个收件人,插入一个签名注释,最后发送信封供签署。
必备条件
- 带有 的 Sign.Plus 帐户的 API 计划
- 您的
个人访问令牌
第 1 步:创建信封
信封是一个由收件人签名的容器。
- 向 POST /v2/信封 端点发送请求以创建一个新信封。
{
"name": "My wonderful envelope",
"flow_type": "REQUEST_SIGNATURE",
"legality_level": "SES",
"expires_at": 1831280113,
"sandbox": true
} - 将您的 API 密钥包含在
授权
头中。 -
一旦成功,您将收到一个
信封
对象。{ "id": "<string>" ... }
-
保存
id
为信封_id
第 2 步:将文档添加到您的信封
-
Use the POST /v2/envelope/{envelope_id}/document endpoint to add a document.
-
Replace
{envelope_id}
with the ID you received in Step 1. - Send a POST request with the document file in the request body as
multipart/form-data.
-
On success, you'll receive a
Document
object as a response.{ "id": "<string>" ... }
-
将
id
另存为文档_id
以供以后使用。
第 3 步:为您的信封设置收件人
-
Use the POST /v2/envelope/{envelope_id}/signing_steps endpoint to add a recipient.
-
Replace
{envelope_id}
with your envelope ID. -
Send a
POST
request with the following JSON body:{
"signing_steps": [
{
"recipients": [
{
"name": "John Doe", "email": "john.doe@example.com", "role": "SIGNER"
} ] } ] } -
成功后,您将收到一组
签名步骤
-
浏览数组并拿起您想要添加签名框架的收件人的
id
名称。 将此id
另存为收件人_id
第 4 步:在您的文档中插入签名注释
Before adding a signature annotation, make sure you've defined your signature in the Sign.Plus platform.
- Use the POST /v2/envelope/{envelope_id}/annotation endpoint to add a signature annotation.
- Replace
{envelope_id}
with your envelope ID. - Send a
POST
request with the following JSON body:{
"recipient_id": "<recipient_id>",
"document_id": "<document_id>",
"page": 1,
"x": 50,
"y": 20,
"width": 20,
"height": 60,
"required": true,
"type": "SIGNATURE",
}用适当的值替换
<recipient_id>
和<document_id>
。
步骤 5:发送您的信封以便签名
- Use the POST /v2/envelope/{envelope_id}/send endpoint to send the envelope.
- Replace
{envelope_id}
with your envelope ID. - Send a
POST
request to this endpoint. - 一旦成功,信封将发送给收件人签字。
五. 结论
您现在已成功使用 sign.Plus eSignature API发送了一份文件供签名。 收件人将收到一封包含签名文档链接的电子邮件通知。
For more detailed information on each API endpoint used in this process, please refer to our API documentation.