问题
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.
回答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.
来源:https://stackoverflow.com/questions/21145250/docusign-api-auto-convert-pdf-fields-to-securefields