0

How to get API to upload a PDF file from my app (Java language), to the docusign?

I was trying to use the Quickstart files from DocuSign but they have only static and I could not find the way to upload the pdf files from my app.

LMi
  • 11
  • 1

1 Answers1

0

The file is sent as a base64 encoded string.

All you have to do is encode your file as base64.

If you got the quickstart to to work just fine, then you're 90% of the way. The file that your app is handling should be loaded into memory and then you should do the same code:

public static Document createDocument(byte[] data, String documentName, String fileExtention, String documentId) {
    Document document = new Document();
    document.setDocumentBase64(Base64.getEncoder().encodeToString(data));
    document.setName(documentName);
    document.setFileExtension(fileExtention);
    document.setDocumentId(documentId);
    return document;
Inbar Gazit
  • 12,566
  • 1
  • 16
  • 23