Bitzsoft.Integrations.ElectronicSignature.DocuSign 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Bitzsoft.Integrations.ElectronicSignature.DocuSign --version 1.0.0
                    
NuGet\Install-Package Bitzsoft.Integrations.ElectronicSignature.DocuSign -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bitzsoft.Integrations.ElectronicSignature.DocuSign" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bitzsoft.Integrations.ElectronicSignature.DocuSign" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Bitzsoft.Integrations.ElectronicSignature.DocuSign" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bitzsoft.Integrations.ElectronicSignature.DocuSign --version 1.0.0
                    
#r "nuget: Bitzsoft.Integrations.ElectronicSignature.DocuSign, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bitzsoft.Integrations.ElectronicSignature.DocuSign@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bitzsoft.Integrations.ElectronicSignature.DocuSign&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Bitzsoft.Integrations.ElectronicSignature.DocuSign&version=1.0.0
                    
Install as a Cake Tool

Bitzsoft.Integrations.ElectronicSignature.DocuSign

DocuSign 电子签章服务实现,基于 DocuSign eSignature REST API v2.1。

功能特性

  • 完整实现 IElectronicSignatureProvider:覆盖合同发起、详情、下载、查看、撤销、签署 URL、签署状态、模板全部统一方法
  • OAuth2 Bearer Token 鉴权:简化模型,调用方自行获取 Access Token(Authorization Code Grant 或 JWT)后注入
  • 信封即合同:DocuSign 的 envelope 对应统一抽象的合同/签署流程
  • 印章不支持:DocuSign 无印章概念,ListSealsAsync / GetSealDetailAsync 抛出 NotSupportedException

安装

dotnet add package Bitzsoft.Integrations.ElectronicSignature.DocuSign
<PackageReference Include="Bitzsoft.Integrations.ElectronicSignature.DocuSign" Version="1.0.0" />

配置

{
  "DocuSign": {
    "BaseUrl": "https://demo.docusign.net/restapi/v2.1/accounts/",
    "AccountId": "your-account-id",
    "AccessToken": "your-oauth2-access-token",
    "Timeout": "00:00:30"
  }
}
参数 必填 默认值 说明
BaseUrl https://demo.docusign.net/restapi/v2.1/accounts/ API 基地址(正式环境 https://{subdomain}.docusign.net/restapi/v2.1/accounts/
AccountId 账户 ID,会拼接到请求路径
AccessToken OAuth2 Bearer 访问令牌
Timeout 00:00:30 HTTP 请求超时
HttpClientName DocuSignElectronicSignatureProvider 命名 HttpClient 标识

注册服务

using Bitzsoft.Integrations.ElectronicSignature.DocuSign;

// 方式一:IConfiguration(默认读取 "DocuSign" 配置节)
services.AddBitzsoftDocuSignElectronicSignature(configuration);

或:

using Bitzsoft.Integrations.ElectronicSignature.DocuSign;

// 方式二:委托配置
services.AddBitzsoftDocuSignElectronicSignature(options =>
{
    options.BaseUrl = "https://demo.docusign.net/restapi/v2.1/accounts/";
    options.AccountId = "your-account-id";
    options.AccessToken = "your-oauth2-access-token";
});

API 映射

统一方法 DocuSign 端点 说明
CreateContractAsync POST /envelopes 创建并立即发送信封(status=sent)
GetContractDetailAsync GET /envelopes/{envelopeId} 含 recipients.signers
DownloadContractAsync GET /envelopes/{envelopeId}/documents 合并后的 PDF
GetContractViewUrlAsync POST /envelopes/{envelopeId}/views/recipient 收件人视图 URL
CancelContractAsync PUT /envelopes/{envelopeId} status=voided
GetSigningUrlAsync POST /envelopes/{envelopeId}/views/recipient 自动查询收件人信息
GetSigningStatusAsync GET /envelopes/{envelopeId}/recipients 汇总签署进度
ListTemplatesAsync GET /templates 模板列表
GetTemplateDetailAsync GET /templates/{templateId} 模板详情
ListSealsAsync / GetSealDetailAsync 抛出 NotSupportedException

使用示例

// 注入 IElectronicSignatureProvider,ProviderName == "DocuSign"
var createResult = await provider.CreateContractAsync(new SimpleContractRequest
{
    Title = "Sales Agreement",
    FileName = "agreement.pdf",
    FileData = await File.ReadAllBytesAsync("agreement.pdf"),
    SignerName = "John Doe",
    SignerEmail = "john@example.com"
});

var envelopeId = createResult.Data!;

// 查询详情、获取签署页面、下载合同
var detail  = await provider.GetContractDetailAsync(envelopeId);
var signUrl = await provider.GetSigningUrlAsync(envelopeId, "recipient-1");
var bytes   = await provider.DownloadContractAsync(envelopeId);

核心类型一览

类型 说明
DocuSignOptions 连接配置(BaseUrl / AccountId / AccessToken / Timeout / HttpClientName)
DocuSignElectronicSignatureProvider IElectronicSignatureProvider 实现
DocuSignHttpClient OAuth2 Bearer 鉴权 HTTP 客户端
DocuSignOptionsValidator 启动期配置校验

依赖

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Bitzsoft.Integrations.ElectronicSignature.DocuSign:

Package Downloads
Bitzsoft.Integrations.ElectronicSignature.All

电子签章聚合包 — 包含君子签 / 法大大 / 爱签 / 上上签 / e签宝 / 契约锁 / 安证通 / 腾讯电子签 / DocuSign / Adobe Sign 全部实现

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 115 8/3/2026
1.0.0 111 8/2/2026