【问题标题】:Resolving PDF form fields to DocuSign tabs using the DocuSign .NET Client library使用 DocuSign .NET 客户端库将 PDF 表单字段解析为 DocuSign 选项卡
【发布时间】:2015-05-06 16:59:04
【问题描述】:

我们希望使用 DocuSign 签署合同。我们的工作流程是在我们的文档服务器上创建文档,其中包含用于在此处签名选项卡、全名选项卡和日期选项卡的表单字段。然后将文档发送到 DocuSign,我正在尝试使用 transformPdfFormFields 将表单字段转换为 SignHere、Fullname 和 DateSigned 选项卡。不幸的是,客户端库目前不支持此功能,因此我正在尝试更改源代码以提供此功能,不幸的是文档和错误响应并没有让这变得太容易。

我遇到了this 在堆栈溢出上发帖,这对我有帮助,但是我看不出与我发送的内容(不起作用)和 SO 帖子中的请求有任何显着差异。我最初在DocuSign forums 上发帖,但被要求在 SO 上发帖。

这是我从 API 返回的其余跟踪信息,其中一些数据是匿名的。

POST: https://demo.docusign.net/restapi/v2/accounts/12345/envelopes?api_password=true

标题:

X-DocuSign-Authentication:<DocuSignCredentials><Username>foo@bar.de</Username><Password>AReallySecurePassword=</Password><IntegratorKey>ABCD-ef1gggg1-111a-1c11-b11e-f1e10111e111</IntegratorKey></DocuSignCredentials>
Content-Type:multipart/form-data; boundary=00000000-0000-0000-0000-000000000000
Host:demo.docusign.net
Content-Length:1052145
Expect:100-continue

请求流:

--00000000-0000-0000-0000-000000000000
Content-Type: application/json
Content-Disposition: form-data

{
    "emailBlurb": "Test Blurb for EnvelopeCreateUsingCompositeTemplates",
    "emailSubject": "Test subject for EnvelopeCreateUsingCompositeTemplates",
    "status": "sent",
    "compositeTemplates": [
        {
            "compositeTemplateId": "1",
            "inlineTemplates": [
                {
                    "sequence": "1",
                    "recipients": {
                        "signers": [
                            {
                                "email": "foo@bar.com",
                                "name": "Signer 1: 981274442609345",
                                "recipientId": "1",
                                "tabs": {
                                    "signHereTabs": [
                                        {
                                            "pageNumber": 0,
                                            "documentId": 1,
                                            "xPosition": 0,
                                            "yPosition": 0,
                                            "height": 0,
                                            "width": 0,
                                            "tabLabel": "Signature_LesseeContractSignature",
                                            "anchorXOffset": 0,
                                            "anchorYOffset": 0,
                                            "required": false,
                                            "recipientId": "1"
                                        }
                                    ],
                                    "fullNameTabs": [
                                        {
                                            "pageNumber": 0,
                                            "documentId": 1,
                                            "xPosition": 0,
                                            "yPosition": 0,
                                            "height": 0,
                                            "width": 0,
                                            "tabLabel": "Signature_LesseeContractFullName",
                                            "anchorXOffset": 0,
                                            "anchorYOffset": 0,
                                            "required": false,
                                            "recipientId": "1"
                                        }
                                    ],
                                    "dateSignedTabs": [
                                        {
                                            "pageNumber": 0,
                                            "documentId": 1,
                                            "xPosition": 0,
                                            "yPosition": 0,
                                            "height": 0,
                                            "width": 0,
                                            "tabLabel": "Signature_LesseeContractDate",
                                            "anchorXOffset": 0,
                                            "anchorYOffset": 0,
                                            "required": false,
                                            "recipientId": "1"
                                        }
                                    ]
                                },
                                "emailNotification": {
                                    "emailBody": "Signer 1 Body: Testing the tabs 981274442659854",
                                    "emailSubject": "Signer 1 Body: 981274442659854",
                                    "supportedLanguage": "en"
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "documents": [
        {
            "documentId": "1",
            "name": "Test Contract With Fields.pdf",
            "transformPdfFields": "true"
        }
    ]
}


--00000000-0000-0000-0000-000000000000
Content-Type: application/pdf
Content-Disposition: file; filename="Test Contract With Fields.pdf"; documentId=1; compositeTemplateId="1"

[file bits go here]

--00000000-0000-0000-0000-000000000000--

回复:

{
  "errorCode": "ENVELOPE_IS_INCOMPLETE",
  "message": "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line."
}

【问题讨论】:

    标签: docusignapi


    【解决方案1】:

    我已经得到了这个工作。需要改变三件事:

    • 为值添加双引号
    • 将 pageNumbers 设置为从 1 开始
    • 将文档数组更改为文档对象

    生成的请求(包括 PDF 表单)在此处:https://gist.github.com/ds-jk/a4990cb3e662c90430c0

    已编辑:出于历史目的,以下原始帖子: 我将在这里继续我们的主题,以吸引更多人关注它。希望我们也可以安排通话。我有一个没有 transformPdfFields 的示例(如下)。我正在尝试将您的修改为尽可能简单并且尚未开始工作。到目前为止,我没有看到任何明显的问题。我会继续努力。

    --f6e755d3-bbcf-44e5-b276-8ae626f97220
    Content-Type: application/json
    Content-Disposition: form-data
    
    {
        "emailSubject": "Inline template with transformPdfFields",
        "emailBlurb": "This converts fields from a PDF and assigns them to a signer.",
        "status": "Sent",
        "recipients": {
            "signers": [
                {
                    "name": "Korben Dallas",
                    "email": "dscomposites@mailnator.com",
                    "clientuserid": "12345",
                    "recipientId": "1",
                    "routingOrder": "1"
                }
            ]
        },
        "documents": [
            {
                "documentId": "1",
                "name": "test doc.pdf"
            }
        ]
    }
    --f6e755d3-bbcf-44e5-b276-8ae626f97220
    Content-Type: application/pdf
    Content-Disposition: file; filename="Test Doc.pdf"; documentid=1
    Content-Transfer-Encoding: base64
    
    <<Base64 PDF Bytes>>
    --f6e755d3-bbcf-44e5-b276-8ae626f97220--
    

    【讨论】:

      猜你喜欢
      • 2015-02-22
      • 1970-01-01
      • 2016-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-01
      • 2016-10-04
      相关资源
      最近更新 更多