hellosign / hellosign-java-sdk

A Java SDK for the HelloSign API.
MIT License
13 stars 27 forks source link

Uploaded files are out of order when signing #75

Open johnnycupcakes opened 6 years ago

johnnycupcakes commented 6 years ago

When sending a signature request using multiple documents the file order does not remain consistent.

This issue is for the /signature_request/create_embedded and /signature_request/send endpoints

Thank you for your help!

jyoung488 commented 6 years ago

A workaround using the Unirest for Java library to send a signature request with ordered files:

HttpResponse<String> response = Unirest.post("https://[api key]:@api.hellosign.com/v3/signature_request/send")
     .header("accept", "application/json")
     .field("signers[0][name]", "Signer Name")
     .field("signers[0][email_address]", "test@example.com")
     .field("title", "Java Unirest Signature Request Title")
     .field("test_mode", 1)
     .field("file[0]", new File("../application.pdf"))
     .field("file[1]", new File("../links.pdf"))
     .field("file[2]", new File("../Psyduck.pdf"))
     .asString();
mashley806 commented 6 years ago

Trying workaround. A fix for this would be great though. :-)

chunker-admin commented 5 years ago

This is a huge issue for anyone using Hellosign to create a legal document with addendum attachments or other legal attachments. In our case, the attachments are getting added in a random order, which is very unhelpful. I have reviewed the code and the problem appears that a Map is used to store the files then when the request is created, the map keys are iterated. Maps are not ordered, and thus the issue.