Incorrectly applied server templates with multiple composite templates

只谈情不闲聊 提交于 2019-12-02 04:18:48

This issue in this example is not the sequence. It is the documentId's for the documents passed in.

When a server side template is created, think of it as having documentId=1. In this case, two server side templates are used, one for each composite template section and each has documentId=1. Tabs placed on these template documents are associated with documentId=1. The documentId of the document passed for each composite template in should also be documentId=1 so when that document overlays, the ID matches.

The example sets the second document passed in as documentId=2. So, when the envelope/template info is folded together, the tabs retain the association with documentId=1, so they appear on page 2 and page 7 of the first document, The second template is overlaid with documentId 2, so it will not have any tabs.

If the passed-in document for both composite templates uses documentId=1, the tabs will properly associate within each composite template, and then the documentID's will be reordered in the final envelope along with tab Id’s.

The sequence numbers can be 1,2,3,4 or 1,2 in the first composite template, and 1,2 in the second.

Working example:

POST http://localhost/restapi/v2/accounts/2/envelopes
X-DocuSign-Authentication: [omitted]
Accept: application/json
Content-Type: multipart/form-data; boundary=70fcb373-f40d-40bb-bddb-204fe789087f
X-DocuSign-ClientTransactionId: T635316112162595227

--70fcb373-f40d-40bb-bddb-204fe789087f
Content-Type: application/json
Content-Disposition: form-data

{
  "compositeTemplates": [
      {
        "compositeTemplateId": "1",
        "serverTemplates": [
          {
            "sequence": "1",
            "templateId": "99B09A06-95AF-47A5-964B-A58E78B981DF"
          }
        ],
        "inlineTemplates": [
          {
            "sequence": "1",
            "recipients": {
              "signers": [
                {
                  "name": "Resty Tester",
                  "email": "resty.tester@gmail.com",
                  "recipientId": "1",
                  "routingOrder": "1",
                  "roleName": "RoleOne"
                }
              ]
            }
          }
        ],
        "document": {
          "documentId": "1",
          "name": "document1In.pdf"
        }
      },
      {
        "compositeTemplateId": "2",
        "serverTemplates": [
          {
            "sequence": "2",
            "templateId": "36FD0433-AAE0-43A7-B795-E06738159A59"
          }
        ],
        "inlineTemplates": [
          {
            "sequence": "2",
            "recipients": {
              "signers": [
                {
                  "name": "Resty Tester",
                  "email": "resty.tester@gmail.com",
                  "recipientId": "1",
                  "routingOrder": "1",
                  "roleName": "RoleOne"
                }
              ]
            }
          }
        ],
        "document": {
          "documentId": "1",
          "name": "document2In.pdf"
        }
      }
    ],
    "status": "created",
    "emailSubject": "Subject PostCompositeTemplate_PLAT_1647_20140328014654",
    "emailBlurb": "Blurb PostCompositeTemplate_PLAT_1647_20140328014654",
    "allowReassign": "false"
  }
  --70fcb373-f40d-40bb-bddb-204fe789087f
  Content-Type: application/pdf
  Content-Disposition: file; filename="document1In.pdf"; documentId=1;             compositeTemplateId="1"
  Content-Transfer-Encoding: base64

  [bytes omitted]
  --70fcb373-f40d-40bb-bddb-204fe789087f
  Content-Type: application/pdf
  Content-Disposition: file; filename="document2In.pdf"; documentId=1; compositeTemplateId="2"
  Content-Transfer-Encoding: base64

  [bytes omitted]
  --70fcb373-f40d-40bb-bddb-204fe789087f--
  201 Created
  Pragma: no-cache
  X-DocuSign-ClientTransactionId: T635316112162595227
  Content-Length: 198
  Cache-Control: no-cache
  Content-Type: application/json; charset=utf-8
  Date: Fri, 28 Mar 2014 20:46:58 GMT
  Expires: -1

  {
    "envelopeId": "5b28e38e-84c0-4af0-a3d0-e3c1e6cee17d",
    "uri": "/envelopes/5b28e38e-84c0-4af0-a3d0-e3c1e6cee17d",
    "statusDateTime": "2014-03-28T20:46:57.4300000Z",
    "status": "created"
  }
Todd

With regards to the sequence see my question here. The sequence number should denote the object sequence within the scope of the current composite template. I increment my seq# for the inline templates and it works fine. That being said, it may not be the issue with regards to the sig page being appended improperly. I'd start there, however. Hope this helps.

I've successfully repro'd the issue you describe, and have tried remedying the issue by using various combinations of sequence value, all to no avail. This seems like a bug to me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!