在 DocuSign 签名过程中添加第二个收件人

Add a second recipient in DocuSign signing process

我更改了一些 DocuSign Sample code 以在签名过程中添加第二个收件人。为了我网站的用户签名和另一个(第 2 个)人希望收到一封电子邮件,要求对文档进行进一步签名。但是我的代码不起作用,我不知道我是否正确添加了第二个收件人:

with open(os.path.join(app_path, file_name_path), 'rb') as file:
    content_bytes = file.read()
base64_file_content = base64.b64encode(content_bytes).decode('ascii')
document = Document(
    document_base64=base64_file_content,
    name='Example document',
    file_extension='pdf',
    document_id=master_id
)
signer = Signer(  # this works on its own
    email=signer_email,
    name=signer_name,
    recipient_id='1',
    routing_order='1',
    client_user_id=client_user_id,
)
signer2 = Signer(
    email='secondperson@example.com',
    name='Some Guy',
    recipient_id='2',
    routing_order='2',
    client_user_id=client_user_id,
)
sign_here = SignHere(
    document_id=str(master_id),
    page_number='1',
    recipient_id='1',
    tab_label='SignHereTab',
    x_position='195',
    y_position='147')
signer.tabs = Tabs(sign_here_tabs=[sign_here])
envelope_definition = EnvelopeDefinition(
    email_subject='Please sign this document sent from the Python SDK',
    documents=[document],
    recipients=Recipients(signers=[signer, signer2]),
    status='sent'
)
api_client = ApiClient()
api_client.host = base_path
api_client.set_default_header('Authorization', 'Bearer ' + access_token)
envelope_api = EnvelopesApi(api_client)
results = envelope_api.create_envelope(account_id,
    envelope_definition=envelope_definition)
envelope_id = results.envelope_id
recipient_view_request = RecipientViewRequest(
    authentication_method=authentication_method,
    client_user_id=client_user_id,
    recipient_id='1',
    return_url=base_url + '/docusign-return',
    user_name=signer_name,
    email=signer_email
)
results = envelope_api.create_recipient_view(account_id, envelope_id,
                                             recipient_view_request=
                                             recipient_view_request)

“secondperson@example.com”地址已添加到 DocuSign,我激活了他们的 DocuSign 帐户。当我 运行 此代码时,签名过程适用于第一个用户。但是,没有电子邮件发送到“secondperson@example.com”,文档也没有出现在第二个人的 DocuSign“需要采取行动”上。我做错了什么?

更新 文档状态在 DocuSign 沙箱上显示“正在等待其他人”,但是当我转到第二个帐户时,“需要采取行动”下没有任何内容。

我看到的几个问题:

client_user_id 属性表示嵌入式签名者

由于第二个签名者设置了 client_user_id 属性,因此他们被视为嵌入式签名者。因此,他们将不会收到签字仪式的电子邮件邀请。

如果您希望第二个签名者成为 remote signer(收到来自 DocuSign 的签名仪式电子邮件邀请),请删除 client_user_id 属性。

例如

signer2 = Signer(
    email='secondperson@example.com',
    name='Some Guy',
    recipient_id='2',
    routing_order='2',
)

签名者不需要 DocuSign 帐户

在你的问题中你是这样说的

The "secondperson@example.com" address has been added to DocuSign and I activated their DocuSign account.

但是(一般而言)签名者不需要需要 DocuSign 帐户。 (在某些特殊情况下他们会这样做,例如第 11 部分合规性签署。)

不要对多个签名者使用相同的client_user_id

有时您确实希望一个信封有多个嵌入式签名者。当您这样做时,不要对多个签名者使用相同的 client_user_id。这是糟糕的形式。在您的 Web 应用程序中使用每个签名者的 id。如果您不在网络应用程序中分配 ID,则使用签名者的电子邮件作为客户端用户 ID。如果您没有他们的电子邮件,请使用 name@example.com.

添加:API签约仪式身份验证

由于签名者不需要付费,也不需要 DocuSign 的用户帐户,开发者的应用程序如何调用 EnvelopeViews:createRecipient 来获取签名者将使用的签名仪式 URL?

答案是使用“系统帐户”——在您的 DocuSign 帐户中创建一个用户,该用户通常代表应用程序或部门。例如 sales@your_company.com.

然后,通过使用 JWT 授权来模拟 sales@your_company.com 系统用户来创建 DocuSign 访问令牌。

您的应用程序使用生成的访问令牌调用 EnvelopeViews:createRecipient 以获取签名仪式 URL。

根据发送信封的用户,系统帐户可能需要也可能不需要管理权限。