Skip to main content

Hi,

I set Base64 document to EnvelopeDefinition, but it return null when calling getEnvelopeDocGenFormFields.

 

bytey] fileBytes = Files.readAllBytes(Paths.get("/Users/.../Document_Template.docx"));
Document document = new Document();
document.setDocumentBase64(Base64.getEncoder().encodeToString(fileBytes));
document.setName("SampleDocument.docx");
document.setFileExtension("docx");
document.setDocumentId("1");

ArrayList<Document> documents = new ArrayList<>();
documents.add(document);
envelopeDefinition.setDocuments(documents);
final EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelopeDefinition);
final String envelopeId = envelopeSummary.getEnvelopeId();

// Get Fields from document that need to be merged with custom data
final DocGenFormFieldResponse formFieldResponse =
envelopesApi.getEnvelopeDocGenFormFields(accountId, envelopeId);

Hi all,

I am trying to upload a document with valid form fields to a new envelope, but getEnvelopeDocGenFormFields can't recognize any fields from Base64. code. I am sure that the form of the document(docx) is valid.

 

bytet] fileBytes = Files.readAllBytes(Paths.get("/Users/.../Document_Template.docx"));

Document document = new Document();

document.setDocumentBase64(Base64.getEncoder().encodeToString(fileBytes));

document.setName("SampleDocument.docx");

document.setFileExtension("docx");

document.setDocumentId("1");

 

ArrayList<Document> documents = new ArrayList<>();

documents.add(document);

envelopeDefinition.setDocuments(documents);

final EnvelopeSummary envelopeSummary = envelopesApi.createEnvelope(accountId, envelopeDefinition);

final String envelopeId = envelopeSummary.getEnvelopeId();

 

// Step 3 - Get Fields from document that need to be merged with custom data

final DocGenFormFieldResponse formFieldResponse =
envelopesApi.getEnvelopeDocGenFormFields(accountId, envelopeId);

 

result:

formFieldResponse.docGenFormFields == null


Reply