I am attempting to use composite templates via the DocuSign REST API and encountering TAB_REFERS_TO_MISSING_DOCUMENT
errors.
There are several posts about this error on StackOverflow, (See, e.g., here, here, here) but unlike the other posts I've read, I am getting this error even when there are no tabs whatsoever in my envelopeDefinition
.
I have two templates set up in my Sandbox, and both have identical recipients: The first recipient, Signer1
, is meant to be supplied by the API request. The second recipient is my company's representative and does not need to be supplied. Both templates are to have a variety of tabs whose values must be populated by the API request, although I've delete all the tabs trying to investigate this problem, to no avail.
I was able to get the templates to work flawlessly on their own. However, trying to use composite templates is confounding me.
My current version of the request body looks like this:
"emailSubject": "Please sign the documents",
"status": "sent",
"compositeTemplates": [
{
"serverTemplates": [
{
"sequence": "1",
"templateId": "153ab223-..."
},
{
"sequence": "2",
"templateId": "54ff1d62-..."
}
],
"inlineTemplates": [
"sequence": "1",
"recipients": {
"signers": [
"clientUserId": <<some_unique_id>>,
"email": <<signer_1_email>>,
"name": <<signer_1_name>>,
"recipientId": "1",
"roleName": "Signer1"
]
}
]
}
]
With this request, or with almost every single other way I've tried structuring my request, I get the same error message:
TAB_REFERS_TO_MISSING_DOCUMENT
The DocumentId specified ... refers to DocumentId 66887495 which is not present.
The document ID number it reports, 66887495
, does seem to be the ID of one of the templates I am using. But:
- It is included in the envelope, in the
serverTemplates
section, so why does it say it is not included in the envelope? - There is no
documentId
anywhere in my request. Why does it seem to think there is? - I have even tried removing all the tabs from both templates via the Sandbox. Even when are no tabs whatsoever involved in this request or these documents, I still get this error.
Any help is very much appreciated. Thank you.