不想在Docusign中下载文档,没有签名是可选的签名。
创始人
2025-01-10 07:30:14
0

以下是一个示例解决方法,使用Docusign的REST API来创建一个可选签名的签名请求。这个示例使用Python编程语言。

import requests
import base64
import json

# 设置Docusign账户信息
base_url = 'https://demo.docusign.net/restapi/v2/accounts/{account_id}'
username = 'your_username'
password = 'your_password'
integrator_key = 'your_integrator_key'

# 构建请求头
auth_header = {
    'Authorization': 'Basic ' + base64.b64encode((username + ':' + password).encode()).decode(),
    'X-DocuSign-Authentication': json.dumps({
        'Username': username,
        'Password': password,
        'IntegratorKey': integrator_key
    })
}

# 构建请求体
data = {
    'status': 'sent',
    'emailSubject': '请签署文档',
    'documents': [{
        'documentId': '1',
        'name': 'document.pdf',
        'documentBase64': base64.b64encode(open('document.pdf', 'rb').read()).decode()
    }],
    'recipients': {
        'signers': [{
            'email': 'recipient@example.com',
            'name': 'Recipient',
            'recipientId': '1',
            'routingOrder': '1',
            'tabs': {
                'signHereTabs': [{
                    'documentId': '1',
                    'pageNumber': '1',
                    'xPosition': '100',
                    'yPosition': '200',
                    'optional': 'true'  # 设置签名为可选
                }]
            }
        }]
    }
}

# 发送请求
response = requests.post(base_url + '/envelopes', headers=auth_header, json=data)

# 处理响应
if response.status_code == 201:
    envelope_id = response.json()['envelopeId']
    print(f'签名请求已创建,envelope ID: {envelope_id}')
else:
    print('创建签名请求失败')
    print(response.content.decode())

请确保替换示例代码中的{account_id}your_usernameyour_passwordyour_integrator_key为您自己的Docusign账户信息。此外,您还需要将document.pdf替换为您要发送的文档的路径。

这个示例中,optional字段被设置为true,以将签名设置为可选项。如果不想下载文档,您可以将documentBase64字段设置为文档的Base64编码字符串,而不是文件路径。

相关内容

热门资讯

截至发稿"微乐小程序... 截至发稿"微乐小程序黑科技,微乐内蒙古自建房脚本免费下载"其实是真的有外开挂神器-20261、该软件...
专业讨论!"微乐小程... 专业讨论!"微乐小程序黑科技,微信微乐陕西挖坑小程序破解器"竟然存在有外开挂脚本-20261、在微乐...
第3分钟窍要!德扑之心免费透视... 第3分钟窍要!德扑之心免费透视(透视)一贯是有辅助下载(哔哩哔哩)该软件可以轻松地帮助玩家将德扑之心...
第七分钟阶段!hhpoker怎... 第七分钟阶段!hhpoker怎么破解(透视)竟然有辅助开挂(哔哩哔哩)该软件可以轻松地帮助玩家将hh...
九分钟秘籍!wepoker私人... 九分钟秘籍!wepoker私人局俱乐部辅助(透视)总是是有辅助下载(哔哩哔哩)1、这是跨平台的wep...
7分钟课程!wepoker究竟... 7分钟课程!wepoker究竟有没有透视(透视)切实是真的有辅助安装(哔哩哔哩)1、用户打开应用后不...
第三分钟教程书!wepoker... 第三分钟教程书!wepoker轻量版辅助(透视)果然有辅助教程(哔哩哔哩)该软件可以轻松地帮助玩家将...
六分钟大纲!wepoker插件... 六分钟大纲!wepoker插件辅助(透视)本来是有辅助透视(哔哩哔哩)运wepoker插件辅助辅助工...
第六分钟策略!拱趴大菠萝挂哪里... 第六分钟策略!拱趴大菠萝挂哪里(透视)好像是真的有辅助神器(哔哩哔哩)1、拱趴大菠萝挂哪里辅助软件下...
5分钟技法!wpk透视工作室(... 5分钟技法!wpk透视工作室(透视)切实是有辅助教程(哔哩哔哩)wpk透视工作室脚本下载中分为三种模...