docusignapidocusigncompositetmplts

Create and send envelope from composite template fails with ONESIGNALLSIGN_NOT_SATISFIED


I would like to create and send an envelope, composed from a template. The template on the server pre-defines a **couple of signer roles, subject and text of the e-mail.

In the inline part I add:

The intention is to assign signing field "customer_1*" to the first recipient (with has to be associated to the first role), and and "customer_2*" to the second recipient (assigned to the second role).

The create API fails with response:

{"errorCode":"ONESIGNALLSIGN_NOT_SATISFIED",
 "message":"Freeform signing is not allowed for your account because it conflicts
            with other settings, please place signing tabs for each signer."}

I cannot understand why it complains about "Freeform signing", while I set tabs for each sign filed group (based on a common prefix).

Here is the the log of an execution attempt:

TraceToken: 3c6f2283-f8bd-4c2e-8fd6-f596536cb3bc
Timestamp: 2021-11-19T14:00:17.8398210Z

POST https://demo.docusign.net:7802/restapi/v2.1/accounts/72b8c45f-0720-4141-ab3d-efdb95122e64/envelopes
Content-Type: application/json
Content-Length: 315096
Connection: keep-alive
Transfer-Encoding: chunked
Accept: application/json
Authorization: Bearer [omitted]
Host: demo.docusign.net
User-Agent: Swagger-Codegen/3.15.0/java
X-DocuSign-SDK: Java
X-SecurityProtocol-Version: TLSv1.2
X-SecurityProtocol-CipherSuite: ECDHE-RSA-AES256-GCM-SHA384
x-forwarded-for: 93.34.232.152

{
  "compositeTemplates": [
    {
      "compositeTemplateId": "1",
      "inlineTemplates": [
        {
          "documents": [
            {
              "documentBase64": "<pdf document encoded in BASE64>",
              "documentId": "1",
              "fileExtension": "pdf",
              "name": "sample2",
              "transformPdfFields": "true"
            }
          ],
          "recipients": {
            "signers": [
              {
                "email": "hilbert@xxxxx.it",
                "fullName": "Mick Hilbert",
                "name": "Mick Hilbert",
                "recipientId": "00016005",
                "recipientSignatureProviders": [
                  {
                    "signatureProviderName": "intesa_tsp_aes",
                    "signatureProviderOptions": {
                      "sms": "+39xxxxxxxxxx"
                    }
                  }
                ],
                "roleName": "CLIENTE2",
                "tabs": {
                  "signHereTabs": [
                    {
                      "anchorString": "firmatario_00016005*"
                    }
                  ]
                }
              },
              {
                "email": "hilbertsmike@xxxxx.it",
                "fullName": "Smike Hilbert",
                "name": "Smike Hilbert",
                "recipientId": "00028471",
                "recipientSignatureProviders": [
                  {
                    "signatureProviderName": "intesa_tsp_aes",
                    "signatureProviderOptions": {
                      "sms": "+39xxxxxxxxxx"
                    }
                  }
                ],
                "roleName": "CLIENTE1",
                "tabs": {
                  "signHereTabs": [
                    {
                      "anchorString": "firmatario_00028471*"
                    }
                  ]
                }
              }
            ]
          },
          "sequence": "2"
        }
      ],
      "serverTemplates": [
        {
          "sequence": "1",
          "templateId": "2c9f039a-1306-4116-9083-096d9b68203b"
        }
      ]
    }
  ],
  "status": "sent"
}

400 BadRequest

Content-Type: application/json; charset=utf-8
Content-Length: 190
X-DocuSign-TraceToken: 3c6f2283-f8bd-4c2e-8fd6-f596536cb3bc

{"errorCode":"ONESIGNALLSIGN_NOT_SATISFIED","message":"Freeform signing is not allowed for your account because it conflicts with other settings, please place signing tabs for each signer."}

I also want to note that signing tabs are not intended to be inserted by DocuSign, but thea are olready present in the original document; I just want to assign the right tabs to each signer based on tab's identifier prefix.

I have tried to create the envelope without referring to the template, with exactly the same data, and it works perfectly, so it looks like the problem is strictly related to the template usage.

I tried both cases (with and without template) as draft, and than to complete the workflow (basically send the envelope) from the DocuSign web site. In the first case, the signing fields disappeared from the document, ant it force me to add some (for each signer) in order to let me send. In the second case, the signing fields are there, and I can just send it, without doing anything else.

I also tried to remove recipients from the template, and fill in all their information at runtime (instead of rely on roles), but the result does not change at all (tabs are removed from document), so there should be something wrong in the information I send to create envelope through composite template. But I copied them from the DocuSign howto.

So now the question is: why creating the envelope by composite template results in signing fields (tabs) to be removed from documents?


Solution

  • I found the answer in a comment of this question. But I do not have any reference to official documentation stating it.

    There was 2 issues preventing the request to be successfully processed:

    Note that, since CompositeTemplate can contain just one document, you need to define multiple CompositeTemplates, one for each document, each containing the ServerTemplate block and the recipient list in the InlineTemplate. Thus the recipients information are replicated.

    Here is an example of request-log with 3 documents and 2 recipients:

    TraceToken: d95c99fa-e05e-4c89-8801-00363b210a87
    Timestamp: 2021-12-06T07:19:11.7302866Z
    
    POST https://demo.docusign.net:7802/restapi/v2.1/accounts/xxxxxx/envelopes
    Content-Type: application/json
    Content-Length: 731974
    Connection: keep-alive
    Transfer-Encoding: chunked
    Accept: application/json
    Authorization: Bearer [omitted]
    Host: demo.docusign.net
    User-Agent: Swagger-Codegen/3.15.0/java
    X-DocuSign-SDK: Java
    X-SecurityProtocol-Version: TLSv1.2
    X-SecurityProtocol-CipherSuite: ECDHE-RSA-AES256-GCM-SHA384
    x-forwarded-for: 93.34.238.73
    
    {
      "compositeTemplates": [
        {
          "compositeTemplateId": "0",
          "document": {
            "documentBase64": "<base64-encoded-pdf>",
            "documentId": "1",
            "fileExtension": "pdf",
            "name": "sample0",
            "transformPdfFields": "true"
          },
          "inlineTemplates": [
            {
              "recipients": {
                "signers": [
                  {
                    "email": "hilbertsmike@xxx.it",
                    "name": "Smike Hilbert",
                    "recipientId": "00028471",
                    "recipientSignatureProviders": [
                      {
                        "signatureProviderName": "intesa_tsp_aes",
                        "signatureProviderOptions": {
                          "sms": "+393201744869"
                        }
                      }
                    ],
                    "roleName": "CLIENTE",
                    "tabs": {
                      "signHereTabs": [
                        {
                          "anchorAllowWhiteSpaceInCharacters": "true",
                          "tabLabel": "firmatario_00028471\\*"
                        }
                      ]
                    }
                  },
                  {
                    "email": "hilbert@xxx.it",
                    "name": "Mick Hilbert",
                    "recipientId": "00016005",
                    "recipientSignatureProviders": [
                      {
                        "signatureProviderName": "intesa_tsp_aes",
                        "signatureProviderOptions": {
                          "sms": "+393201744869"
                        }
                      }
                    ],
                    "roleName": "CLIENTE",
                    "tabs": {
                      "signHereTabs": [
                        {
                          "anchorAllowWhiteSpaceInCharacters": "true",
                          "tabLabel": "firmatario_00016005\\*"
                        }
                      ]
                    }
                  }
                ]
              },
              "sequence": "2"
            }
          ],
          "serverTemplates": [
            {
              "sequence": "1",
              "templateId": "7e82f2b4-0a1d-4145-b748-3a90eb001e5d"
            }
          ]
        },
        {
          "compositeTemplateId": "0",
          "document": {
            "documentBase64": "<base64-encoded-pdf>",
            "documentId": "2",
            "fileExtension": "pdf",
            "name": "sample2a",
            "transformPdfFields": "true"
          },
          "inlineTemplates": [
            {
              "recipients": {
                "signers": [
                  {
                    "email": "hilbertsmike@xxx.it",
                    "name": "Smike Hilbert",
                    "recipientId": "00028471",
                    "recipientSignatureProviders": [
                      {
                        "signatureProviderName": "intesa_tsp_aes",
                        "signatureProviderOptions": {
                          "sms": "+393201744869"
                        }
                      }
                    ],
                    "roleName": "CLIENTE",
                    "tabs": {
                      "signHereTabs": [
                        {
                          "anchorAllowWhiteSpaceInCharacters": "true",
                          "tabLabel": "firmatario_00028471\\*"
                        }
                      ]
                    }
                  },
                  {
                    "email": "hilbert@xxx.it",
                    "name": "Mick Hilbert",
                    "recipientId": "00016005",
                    "recipientSignatureProviders": [
                      {
                        "signatureProviderName": "intesa_tsp_aes",
                        "signatureProviderOptions": {
                          "sms": "+393201744869"
                        }
                      }
                    ],
                    "roleName": "CLIENTE",
                    "tabs": {
                      "signHereTabs": [
                        {
                          "anchorAllowWhiteSpaceInCharacters": "true",
                          "tabLabel": "firmatario_00016005\\*"
                        }
                      ]
                    }
                  }
                ]
              },
              "sequence": "2"
            }
          ],
          "serverTemplates": [
            {
              "sequence": "1",
              "templateId": "7e82f2b4-0a1d-4145-b748-3a90eb001e5d"
            }
          ]
        },
        {
          "compositeTemplateId": "0",
          "document": {
            "documentBase64": "<base64-encoded-pdf>",
            "documentId": "3",
            "fileExtension": "pdf",
            "name": "sample2b",
            "transformPdfFields": "true"
          },
          "inlineTemplates": [
            {
              "recipients": {
                "signers": [
                  {
                    "email": "hilbertsmike@xxx.it",
                    "name": "Smike Hilbert",
                    "recipientId": "00028471",
                    "recipientSignatureProviders": [
                      {
                        "signatureProviderName": "intesa_tsp_aes",
                        "signatureProviderOptions": {
                          "sms": "+393201744869"
                        }
                      }
                    ],
                    "roleName": "CLIENTE",
                    "tabs": {
                      "signHereTabs": [
                        {
                          "anchorAllowWhiteSpaceInCharacters": "true",
                          "tabLabel": "firmatario_00028471\\*"
                        }
                      ]
                    }
                  },
                  {
                    "email": "hilbert@xxx.it",
                    "name": "Mick Hilbert",
                    "recipientId": "00016005",
                    "recipientSignatureProviders": [
                      {
                        "signatureProviderName": "intesa_tsp_aes",
                        "signatureProviderOptions": {
                          "sms": "+393201744869"
                        }
                      }
                    ],
                    "roleName": "CLIENTE",
                    "tabs": {
                      "signHereTabs": [
                        {
                          "anchorAllowWhiteSpaceInCharacters": "true",
                          "tabLabel": "firmatario_00016005\\*"
                        }
                      ]
                    }
                  }
                ]
              },
              "sequence": "2"
            }
          ],
          "serverTemplates": [
            {
              "sequence": "1",
              "templateId": "7e82f2b4-0a1d-4145-b748-3a90eb001e5d"
            }
          ]
        }
      ],
      "status": "sent"
    }
    
    201 Created
    
    Content-Type: application/json; charset=utf-8
    Content-Length: 173
    X-DocuSign-TraceToken: d95c99fa-e05e-4c89-8801-00363b210a87
    
    {"envelopeId":"2b54207d-c9cf-4b8b-ab11-5325c1b118aa","uri":"/envelopes/xxx","statusDateTime":"2021-12-06T07:19:11.1530000Z","status":"sent"}