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?
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?