1

The envelopes.getDocument method wraps EnvelopeDocuments:get and return a PDF file as a byte stream. Alternatively you can request a base64-encoded string.

My question is: Is it possible to stream that file chunk by chunk instead of downloading and storing the whole file in memory?

uzluisf
  • 2,586
  • 1
  • 9
  • 27

1 Answers1

1

Sorry, downloading chunk by chunk is not supported at the DocuSign API application level. However, at the TCP (transport) layer, the response is delivered chunk by chunk.

So depending on the cleverness of your http client library, you may be able to stream the file response.

Just curious, since the price of virtual memory is pretty low these days, what is driving your question?

Added

Axios response stream

Larry K
  • 47,808
  • 15
  • 87
  • 140
  • 1
    The code that interacts with the eSignature API's NodeJS SDK runs on a AWS lambda, and there's a good chance it will handle hundreds of files daily (something like 200) so I figured this could be a good chance to use streams and probably keep memory costs at a minimal. Thanks! – uzluisf Apr 25 '23 at 13:49