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

相关内容

热门资讯

推荐十款!poker worl... 推荐十款!poker world辅助器,xpoker辅助助手,wepoke教程(有挂解说)1、pok...
一分钟揭秘!哈糖大菠萝怎么开挂... 一分钟揭秘!哈糖大菠萝怎么开挂,sohoo辅助,必胜教程(有挂教程)暗藏猫腻,小编详细说明哈糖大菠萝...
攻略讲解!we poker免费... 攻略讲解!we poker免费辅助器(透视脚本)详细透视辅助黑科技(好像是真的有挂)亲,关键说明,w...
重大通报!聚星ai辅助工具收费... 重大通报!聚星ai辅助工具收费多少(透视脚本)详细透视辅助机制(确实真的是有挂)1、聚星ai辅助工具...
终于知道!xpoker辅助怎么... 终于知道!xpoker辅助怎么用,拱趴大菠萝作弊方法,可靠教程(有挂介绍)1、首先打开拱趴大菠萝作弊...
教学盘点!epoker免费透视... 教学盘点!epoker免费透视脚本,xpoker怎么作弊,玩家教你(有挂攻略);亲,关键说明,epo...
我来教教大家!xpoker透视... 我来教教大家!xpoker透视辅助(透视脚本)详细透视辅助挂(好像是真的有挂)1、每一步都需要思考,...
今日百科!德州之星扫描器,约局... 今日百科!德州之星扫描器,约局吧德州真的有透视挂吗,新2025教程(有挂技巧)在进入约局吧德州真的有...
玩家必看科普!德州透视脚本,x... 玩家必看科普!德州透视脚本,xpoker辅助助手,攻略方法(有挂解密);1、上手简单,内置详细流程视...
八分钟德州局透视!德州辅助工具... 八分钟德州局透视!德州辅助工具到底怎么样,智星德州辅助译码插件靠谱吗,详细教程(有挂方法);1、该软...