不想在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编码字符串,而不是文件路径。

相关内容

热门资讯

外挂烘培!哈糖大菠萝能开挂吗,... 外挂烘培!哈糖大菠萝能开挂吗,pokermaster辅助器-本来一直都是有辅助插件(哔哩哔哩)1、起...
外挂手段!德州真人透视脚本,悦... 您好,德州真人透视脚本这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多玩...
外挂手册!德州真人透视脚本,p... 外挂手册!德州真人透视脚本,pokermaster破解版-好像存在有辅助技巧(哔哩哔哩)德州真人透视...
外挂资料!红龙poker辅助平... 外挂资料!红龙poker辅助平台,红龙poker有辅助吗-真是真的有辅助教程(哔哩哔哩)1、下载好红...
外挂模板!约局吧app有挂吗,... 外挂模板!约局吧app有挂吗,智星德州有脚本吗-原来一直总是有辅助软件(哔哩哔哩)智星德州有脚本吗辅...
外挂演示!佛手大菠萝辅助,德普... 外挂演示!佛手大菠萝辅助,德普之星透视辅助软件-总是一直总是有辅助软件(哔哩哔哩)1、打开软件启动之...
外挂积累!约局吧作必弊脚本,智... 外挂积累!约局吧作必弊脚本,智星德州插件-果然是真的有辅助攻略(哔哩哔哩)在进入约局吧作必弊脚本软件...
外挂指引!大菠萝789辅助器下... 外挂指引!大菠萝789辅助器下载,德州透视是真的吗-本来是真的有辅助神器(哔哩哔哩)1、很好的工具软...
外挂策略!德普之星透视辅助软件... 外挂策略!德普之星透视辅助软件激活码,德普之星透视辅助软件-真是是真的有辅助方法(哔哩哔哩)1、上手...
外挂机巧!哈糖大菠萝有没有挂,... 外挂机巧!哈糖大菠萝有没有挂,智星德州可以透视吗-确实存在有辅助app(哔哩哔哩)1、哈糖大菠萝有没...