尝试通过Rest API在Docusign中预填充文本选项卡

时间:2014-06-26 22:30:11

标签: php json rest docusignapi

我在docusign控制台中为我的服务器模板预填充textTabs时出现问题。我的应用程序在我们的结束时生成一个协议,并作为复合模板添加,另一个表单作为带有模板ID的服务器模板添加。

服务器模板有几个用户需要填写的字段。已使用docusign控制台中的管理模板工具定义和添加选项卡。

发送文档没有问题,signHereTab是唯一正确添加到表单中的文件。

我遇到的两个问题是:1)用户应填写的字段从未显示在收到的文件上; 2)我发送的预填信息未被docusign接收。下面是我发送给docusign REST API的正文请求:

{
   "emailSubject":"Nexogy Service Agreement Signature Request",
   "emailBlurb":"Thank you for your interest in our services. Please sign the following agreement to continue with your service installation.",
   "status":"sent",
   "emailSettings":{
      "replyEmailAddressOverride":"sales@nexogy.com",
      "replyEmailNameOverride":"Nexogy",
      "bccEmailAddresses":[

      ]
   },
   "eventNotification":{
      "url":"https:\/\/dna.local.com\/documents\/set-status",
      "loggingEnabled":true,
      "requireAcknowledgment":true,
      "useSoapInterface":false,
      "includeDocuments":false,
      "includeSenderAccountAsCustomField":true,
      "envelopeEvents":[
         {
            "envelopeEventStatusCode":"Sent"
         },
         {
            "envelopeEventStatusCode":"Delivered"
         },
         {
            "envelopeEventStatusCode":"Signed"
         },
         {
            "envelopeEventStatusCode":"Voided"
         },
         {
            "envelopeEventStatusCode":"Declinded",
            "includeDocuments":true
         },
         {
            "envelopeEventStatusCode":"Completed",
            "includeDocuments":true
         }
      ]
   },
   "recipients":{
      "signers":[
         {
            "email":"mmoreno509@gmail.com",
            "name":"Test Tester",
            "roleName":"Signer1",
            "recipientId":718
         }
      ]
   },
   "compositeTemplates":[
      {
         "inlineTemplates":[
            {
               "sequence":1,
               "recipients":{
                  "signers":[
                     {
                        "email":"mmoreno509@gmail.com",
                        "name":"Test Tester",
                        "roleName":"Signer1",
                        "recipientId":718,
                        "tabs":{
                           "signHereTabs":[
                              {
                                 "xPosition":100,
                                 "yPosition":205,
                                 "documentId":1,
                                 "pageNumber":6,
                                 "fontColor":"BrightBlue"
                              }
                           ]
                        }
                     }
                  ]
               },
               "documents":[
                  {
                     "documentId":1,
                     "name":"ChuyMPDFAgreement.pdf",
                     "remoteUrl":"https:\/\/s3.amazonaws.com\/dna_local\/ChuyMPDFAgreement.pdf"
                  }
               ]
            }
         ]
      },
      {
         "serverTemplates":[
            {
               "sequence":2,
               "templateId":"ae435358-1410-40fd-803e-273028d19287",
               "recipients":{
                  "signers":[
                     {
                        "email":"mmoreno509@gmail.com",
                        "name":"Test Tester",
                        "roleName":"Signer1",
                        "recipientId":718,
                        "tabs":{
                           "textTabs":[
                              {
                                 "tabLabel":"Full Name",
                                 "value":"Test Tester",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":123123123,
                                 "value":123123123,
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"Address",
                                 "value":"Test",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"City",
                                 "value":"Hollywood",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"State",
                                 "value":"FL",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"ZipCode",
                                 "value":33081,
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"Country",
                                 "value":"US",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"Phone",
                                 "value":"3454657676",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"AccountName",
                                 "value":"Testing Company",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"\\*FullName",
                                 "value":"Test Tester",
                                 "pageNumber":"1"
                              }
                           ]
                        }
                     }
                  ]
               }
            }
         ]
      },
      {
         "serverTemplates":[
            {
               "sequence":3,
               "templateId":"017d0d20-754b-4093-8896-ff1c00ee2cda",
               "recipients":{
                  "signers":[
                     {
                        "email":"mmoreno509@gmail.com",
                        "name":"Test Tester",
                        "roleName":"Signer1",
                        "recipientId":718,
                        "tabs":{
                           "textTabs":[
                              {
                                 "tabLabel":"AccountName",
                                 "value":"Testing Company",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":123123123,
                                 "value":123123123,
                                 "pageNumber":"2"
                              }
                           ]
                        }
                     }
                  ]
               }
            }
         ]
      },
      {
         "serverTemplates":[
            {
               "sequence":4,
               "templateId":"11a88684-07ac-4ee5-9994-cb88635fb42f",
               "recipients":{
                  "signers":[
                     {
                        "email":"mmoreno509@gmail.com",
                        "name":"Test Tester",
                        "roleName":"Signer1",
                        "recipientId":718,
                        "tabs":{
                           "textTabs":[
                              {
                                 "tabLabel":"AccountName",
                                 "value":"Testing Company",
                                 "pageNumber":"2"
                              },
                              {
                                 "tabLabel":"Address",
                                 "value":"Test",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"City",
                                 "value":"Hollywood",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"State",
                                 "value":"FL",
                                 "pageNumber":"1"
                              },
                              {
                                 "tabLabel":"ZipCode",
                                 "value":33081,
                                 "pageNumber":"1"
                              }
                           ]
                        }
                     }
                  ]
               }
            }
         ]
      }
   ]
}

1 个答案:

答案 0 :(得分:1)

此时创建信封时无法更新模板标签。

您的 signHereTabs 位于 inlineTemplate 中,这会在信封中添加其他标记。

如果您想通过API更新模板中包含的选项卡,您的工作流程应如下所示:

  1. 创建信封 - ("status" : "created"
  2. 修改信封 - 在此处编辑标签
  3. 发送信封
  4. 有关构建此工作流程的所有文档都位于DocuSign REST API Guide