0

We are looking to use DocuSign for signing contracts. Our workflow is that the documents are created on our document server with form fields for sign here tabs, full name tabs and date tabs. The document is then sent to DocuSign and I am trying to use transformPdfFormFields to convert the form fields into SignHere, Fullname and DateSigned tabs. Unfortunately the client library does not currently support this so I am attempting to change the source code to provide this feature, unfortunately the documentation and error responses aren't making this too easy.

I came across this posting on stack overflow which has helped me, however I cannot see any significant difference from what I'm sending (which doesn't work) and the request that is working in the SO post. I had originally posted in the DocuSign forums but was asked to post on SO instead.

Here's the rest trace that I get back from the API with some of the data anonymised.

POST: https://demo.docusign.net/restapi/v2/accounts/12345/envelopes?api_password=true

Headers:

X-DocuSign-Authentication:<DocuSignCredentials><Username>foo@bar.de</Username><Password>AReallySecurePassword=</Password><IntegratorKey>ABCD-ef1gggg1-111a-1c11-b11e-f1e10111e111</IntegratorKey></DocuSignCredentials>
Content-Type:multipart/form-data; boundary=00000000-0000-0000-0000-000000000000
Host:demo.docusign.net
Content-Length:1052145
Expect:100-continue

Request Stream:

--00000000-0000-0000-0000-000000000000
Content-Type: application/json
Content-Disposition: form-data

{
    "emailBlurb": "Test Blurb for EnvelopeCreateUsingCompositeTemplates",
    "emailSubject": "Test subject for EnvelopeCreateUsingCompositeTemplates",
    "status": "sent",
    "compositeTemplates": [
        {
            "compositeTemplateId": "1",
            "inlineTemplates": [
                {
                    "sequence": "1",
                    "recipients": {
                        "signers": [
                            {
                                "email": "foo@bar.com",
                                "name": "Signer 1: 981274442609345",
                                "recipientId": "1",
                                "tabs": {
                                    "signHereTabs": [
                                        {
                                            "pageNumber": 0,
                                            "documentId": 1,
                                            "xPosition": 0,
                                            "yPosition": 0,
                                            "height": 0,
                                            "width": 0,
                                            "tabLabel": "Signature_LesseeContractSignature",
                                            "anchorXOffset": 0,
                                            "anchorYOffset": 0,
                                            "required": false,
                                            "recipientId": "1"
                                        }
                                    ],
                                    "fullNameTabs": [
                                        {
                                            "pageNumber": 0,
                                            "documentId": 1,
                                            "xPosition": 0,
                                            "yPosition": 0,
                                            "height": 0,
                                            "width": 0,
                                            "tabLabel": "Signature_LesseeContractFullName",
                                            "anchorXOffset": 0,
                                            "anchorYOffset": 0,
                                            "required": false,
                                            "recipientId": "1"
                                        }
                                    ],
                                    "dateSignedTabs": [
                                        {
                                            "pageNumber": 0,
                                            "documentId": 1,
                                            "xPosition": 0,
                                            "yPosition": 0,
                                            "height": 0,
                                            "width": 0,
                                            "tabLabel": "Signature_LesseeContractDate",
                                            "anchorXOffset": 0,
                                            "anchorYOffset": 0,
                                            "required": false,
                                            "recipientId": "1"
                                        }
                                    ]
                                },
                                "emailNotification": {
                                    "emailBody": "Signer 1 Body: Testing the tabs 981274442659854",
                                    "emailSubject": "Signer 1 Body: 981274442659854",
                                    "supportedLanguage": "en"
                                }
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "documents": [
        {
            "documentId": "1",
            "name": "Test Contract With Fields.pdf",
            "transformPdfFields": "true"
        }
    ]
}


--00000000-0000-0000-0000-000000000000
Content-Type: application/pdf
Content-Disposition: file; filename="Test Contract With Fields.pdf"; documentId=1; compositeTemplateId="1"

[file bits go here]

--00000000-0000-0000-0000-000000000000--

Response:

{
  "errorCode": "ENVELOPE_IS_INCOMPLETE",
  "message": "The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line."
}
Community
  • 1
  • 1
Mark
  • 2,392
  • 4
  • 21
  • 42

1 Answers1

0

I have gotten this working. There were three things to change:

  • Add double-quotes to values
  • Set pageNumbers to be 1-based
  • Change documents array to a document object

The resulting request (including a PDF form) is here: https://gist.github.com/ds-jk/a4990cb3e662c90430c0

Edited: Original post below for historical purposes: I'll continue our thread here to get more eyes on it. Hopefully we can schedule a call as well. I have a sample that works without transformPdfFields (below). I'm trying to modify yours to be as simple as possible and haven't gotten to work. So far I don't see any glaring issues though. I'll continue to work on this.

--f6e755d3-bbcf-44e5-b276-8ae626f97220
Content-Type: application/json
Content-Disposition: form-data

{
    "emailSubject": "Inline template with transformPdfFields",
    "emailBlurb": "This converts fields from a PDF and assigns them to a signer.",
    "status": "Sent",
    "recipients": {
        "signers": [
            {
                "name": "Korben Dallas",
                "email": "dscomposites@mailnator.com",
                "clientuserid": "12345",
                "recipientId": "1",
                "routingOrder": "1"
            }
        ]
    },
    "documents": [
        {
            "documentId": "1",
            "name": "test doc.pdf"
        }
    ]
}
--f6e755d3-bbcf-44e5-b276-8ae626f97220
Content-Type: application/pdf
Content-Disposition: file; filename="Test Doc.pdf"; documentid=1
Content-Transfer-Encoding: base64

<<Base64 PDF Bytes>>
--f6e755d3-bbcf-44e5-b276-8ae626f97220--
Jeff Kyllo
  • 698
  • 3
  • 8