From c2d3d225b1b60f4f62c241eac015cf12f5c0f0bf Mon Sep 17 00:00:00 2001 From: "alex.khalevine" Date: Wed, 5 May 2021 10:46:30 +0200 Subject: [PATCH] improved download document example --- examples/download_document.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/download_document.rb b/examples/download_document.rb index 15b7310..ac1c541 100644 --- a/examples/download_document.rb +++ b/examples/download_document.rb @@ -2,8 +2,10 @@ client = Eversign::Client.new -for document in client.get_all_documents() - client.download_raw_document_to_path(document.document_hash, 'raw.pdf') - client.download_final_document_to_path(document.document_hash, 'final.pdf') - break -end +documents = client.get_all_documents() + +# paradox discovered: documents.first is actually last added document +document = documents.first + +client.download_raw_document_to_path(document.document_hash, 'raw.pdf') +client.download_final_document_to_path(document.document_hash, 'final.pdf') \ No newline at end of file