Arul Dhesiaseelan
Arul Dhesiaseelan

Reputation: 2009

DocuSign Request Signature by providing a pre-filled pdf document, while referencing the template id in DocuSign which defines the signature tab

I have a PDF document stored as Docusign Template that just defines a signature tab and no other information is filled in that PDF. From my application, I will be providing the same PDF with information filled in. Is it possible to request signature from my client providing the pre-filled PDF and reference the Docusign Template, so the signature tab shows up with the pre-filled data?

I am not sure if there is an API that supports this requirement. I looked at using composite templates, but it did not work as I expected, may be I was using it wrong. Here is the json request:

--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data

--BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="form4506-doe.pdf"; documentId=1

{
"emailSubject": "Sent from a Template",
"templateRoles": [],
"status": "sent",
"compositeTemplates": [
{
  "serverTemplates": [
    {
      "sequence": "1",
      "templateId": "10ce17a0-0a25-4485-883c-72c1da059d13"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "1",
      "recipients": {
        "editors": [],
        "agents": [],
        "signers": [
          {
            "clientUserId": "1",
            "recipientId": "1",
            "name": "John Doe",
            "email": "[email protected]"
          }
        ],
        "certifiedDeliveries": [],
        "carbonCopies": []
      }
    }
  ],
  "document": {
    "name": "form4506-doe.pdf",
    "documentId": "1"
  }
}
]
}

--BOUNDARY--

This request sent the pre-filled PDF to the client, but the signature tab is missing (which I expect it to have come from the template). Appreciate any help from DocuSign support.

Upvotes: 0

Views: 109

Answers (1)

Arul Dhesiaseelan
Arul Dhesiaseelan

Reputation: 2009

I think I figured out the working combination. RoleName is required to be set on the Signer object, which shows the Signature tab on the merged template. Sequence needs to be re-ordered. Server template should be set to sequence 2 and inline template should be set to sequence 1. Document id should point to the document id from DocuSign template documents. Here is the working json request:

--BOUNDARY
Content-Type: application/json
Content-Disposition: form-data

{
"emailSubject": "Sent from a Template",
"templateRoles": [],
"status": "sent",
"compositeTemplates": [
{
  "compositeTemplateId": "1",
  "serverTemplates": [
    {
      "sequence": "2",
      "templateId": "10ce17a0-0a25-4485-883c-72c1da059d13"
    }
  ],
  "inlineTemplates": [
    {
      "sequence": "1",
      "recipients": {
        "editors": [],
        "agents": [],
        "signers": [
          {
            "clientUserId": "1",
            "recipientId": "1",
            "name": "John Doe",
            "email": "[email protected]",
            "roleName": "borrower"
          }
        ],
        "certifiedDeliveries": [],
        "carbonCopies": []
      },
      "documents": [
        {
          "name": "form4506-doe.pdf",
          "documentId": "98141843"
        }
      ]
    }
  ]
}
]}
--BOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename="form4506-doe.pdf"; documentId=98141843

<bytes of PDF removed>

--BOUNDARY--

Upvotes: 1

Related Questions