-->

Docusign composite template giving TAB_REFERS_TO_M

2019-09-11 21:49发布

问题:

I was trying to use these two templates as a composite template thru the REST api. I sent out each template on its own and it worked fine. Here is the request from the log file:

Content-Length: 1526
Host: demo.docusign.net
X-DocuSign-Authentication: {"Username":"Kathleen.Jones@XXX.com","Password":"[omitted]","IntegratorKey":"[omitted]"}
X-Forwarded-For: 63.118.233.100, 104.129.194.117

{
  "compositeTemplates": [
    {
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "2d743750-f910-4a30-ad34-ac5bc0ca8daa"
        },
        {
          "sequence": "2",
          "templateId": "63479d79-a776-4767-a2a3-1ebd01d7d8fa "
        }
      ],
      "inlineTemplates": [
        {
          "sequence": "1",
          "recipients": {
            "signers": [
              {
                "name": "Joe Blow",
                "email": "JoeBlow@outlook.com",
                "recipientId": "1",
                "roleName": "CEO"
              },
              {
                "name": "Kathy Blow",
                "email": "KathyBlow@outlook.com",
                "recipientId": "2",
                "roleName": "Uber CEO"
              }
            ]
          }
        },
        {
          "sequence": "2",
          "recipients": {
            "signers": [
              {
                "name": "Joe Blow",
                "email": "JoeBloww@outlook.com",
                "recipientId": "2",
                "roleName": "Uber CEO"
              },
              {
                "name": "Kathy Blow",
                "email": "KathyBlow@outlook.com",
                "recipientId": "1",
                "roleName": "CEO"
              }
            ]
          }
        }
      ]
    }
  ],
  "status": "sent",
  "emailSubject": "Please Sign the enclosed docs at your earliest convenience"
}
400 BadRequest
Content-Type: application/json; charset=utf-8
X-DocuSign-TraceToken: cb23f0ed-6be2-4189-9237-5575671f8f4b

{
  "errorCode": "TAB_REFERS_TO_MISSING_DOCUMENT",
  "message": "The DocumentId specified in the tab element does not refer to a document in this envelope. Tab refers to DocumentId 15100956 which is not present."
}

Like I said, I used the 2 templates standalone and they went out fine. Any ideas?

回答1:

I found the answer right here in a StackOverflow answer:

In the request JSON you posted, you're specifying "documents" (plural) as a collection/array of document objects -- which isn't correct. Each Composite Template item within the compositeTemplates array can only contain, at most, a single document.