1

When using the DocuSign API to create a new template, is there a way to automatically convert PDF fields to DocuSign SecureFields like there is when using the web console?

Posting to:

https://demo.docusign.net/restapi/v2/accounts/{account_id}/templates

Request body:

{
        "emailsubject":"Please sign this",
        "templateId":"",
        "recipients":{
            "signers":[{
                "routingOrder":1,
                "roleName":"RoleOne",
                "recipientId":"1"
            }]
        },
        "envelopeTemplateDefinition":{
            "name":"test",
            "templateId":""
        },
        "documents":[{
            "documentId":"1",
            "name":"Agreement8_7_2012",
            "transformPdfFields":"true"
        }]
      }

I get a successful response and the template is created, just without any DocuSign SecureFields.

blowfish
  • 23
  • 2

1 Answers1

1

First, try setting the defaultRecipient property to true for the recipient:

"recipients":{
    "signers":[{
        "routingOrder":1,
        "roleName":"RoleOne",
        "recipientId":"1",
        "defaultRecipient":"true"
    }]
}

This will tell DocuSign that all PDF fields that are transformed into DocuSign fields should belong to that recipient.

If that change doesn't resolve your issue, then I'd suspect that perhaps it's the properties of the PDF fields that are preventing the transformation from being successful. To troubleshoot, I'd suggest that you do the following:

  • Verify that the fields in your PDF are amongst the Field Types that DocuSign will convert (i.e.: CheckBox, DateTime, ListBox, Numeric, Radio, Text, Signature, and Password).

  • Examine field properties in the PDF. Seems like DocuSign may not transform PDF fields that have certain protective properties set (for example, Visible=false -- or for signature fields, Read-Only=true). Perhaps start experimenting with various property settings on a single field, to see if changing field properties in the PDF enables DocuSign to transform that field.

The "Transform PDF Fields" section [starting on page 105] of the DocuSign REST API Guide (http://www.docusign.com/sites/default/files/REST_API_Guide_v2.pdf) contains info about the field transformation process.

Kim Brandl
  • 13,125
  • 2
  • 16
  • 21
  • I set the default recipient and verified all of the fields are plain Jane text fields and they're still not converting. Thanks for the suggestions but I suppose I'll stick with the web console for creating templates. – blowfish Jan 15 '14 at 20:56
  • Interesting -- thnaks for the update. I've never used "transformPdfFields" when creating a Template via the API, but I can't imagine it not being supported. I may do some more troublehooting later, as I'm intrigued as to why it transformPdfFields wouldn't work the same when creating a Template as it does when creating an Envelope. I'll add more info here if/when I come up with anything potentially useful. – Kim Brandl Jan 15 '14 at 22:53
  • try using the compositeTemplates node then it should work. – Naseeruddin V N Sep 10 '17 at 20:27