how to download a attachment via JAVA SDK call when the package is complete
Friday, July 3, 2020 at 01:18pm
0
votes
Hi,
Could you please let me know how to download a attachment via JAVA SDK call when the package is complete?
Thanks
Wendy
July 3Created
July 3Last Updated
3 years agoLast Reply
8Replies
102Views
3Users
0Likes
0Links
Duo_Liang | Posts: 3776
Reply to: how to download a attachment via JAVA SDK call when the package is complete
Friday, July 3, 2020 at 01:49pm
0
votes
Hi Wendy,
Java SDK offers below functions:
//Download A single attachment (requires the attachment id)
DownloadedFile downloadedAttachment = client.getAttachmentRequirementService().downloadAttachmentFile(packageId, attachmentId);
Files.saveTo(downloadedAttachment.getContents(), downloadedAttachment.getFilename());
//Download All attachments in a package
DownloadedFile downloadedAllAttachmentsForPackage = client.getAttachmentRequirementService().downloadAllAttachmentFilesForPackage(packageId);
Files.saveTo(downloadedAllAttachmentsForPackage.getContents(), "downloadedAllAttachmentsForPackage.zip");
//Download All attachments from a particular signer
DownloadedFile downloadedAllAttachmentsForSigner1InPackage = client.getAttachmentRequirementService().downloadAllAttachmentFilesForSignerInPackage(myPackage, signer1);
Files.saveTo(downloadedAllAttachmentsForSigner1InPackage.getContents(), "downloadedAllAttachmentsForSigner.zip");
when create package with attachment with the below code:
.withSigner(newSignerWithEmail("[email protected]")
.withFirstName("John")
.withLastName("Doe")
.withCustomId("Signer1")
.withAttachmentRequirement(newAttachmentRequirementWithName("Driver's license")
.withDescription("Please upload a copy of your driver’s license.")
.isRequiredAttachment()
.build()))
when download the attachment with the below code, how to find attachment id?
//Download A single attachment (requires the attachment id)
DownloadedFile downloadedAttachment = client.getAttachmentRequirementService().downloadAttachmentFile(packageId, attachmentId);
Files.saveTo(downloadedAttachment.getContents(), downloadedAttachment.getFilename());
Reply to: how to download a attachment via JAVA SDK call when the package is complete
Friday, July 17, 2020 at 08:56am
0
votes
Hi Wendy,
Try to create the AttachmentRequirement object separately:
AttachmentRequirement attachmentRequirement = AttachmentRequirementBuilder.newAttachmentRequirementWithName("Driver's license")
.withDescription("Please upload a copy of your driver’s license.")
.isRequiredAttachment()
.build();
attachmentRequirement.setId("myAttachmentId");
Reply to: how to download a attachment via JAVA SDK call when the package is complete
Thursday, June 24, 2021 at 09:42pm
0
votes
Hi Duo!
I was facing a similar issue and take the AttachmentRequirement creation using a custom id.
In what state should the transaction be to get the attachement downloaded by the custom id?
I've created a transaction with id t-7Yt2FLAruJWcik9dd2ESFV28s=, but when try to download, get an 404 exception:
com.silanis.esl.sdk.internal.RequestException: HTTP GET on URI https://sandbox.esignlive.com/api/packages/t-7Yt2FLAruJWcik9dd2ESFV28s=/attachment/41ee5ebe-01b1-432c-b915-183d5fb6ef67popa resulted in response with status code: [404, Not Found]. Optional details: {"technical":"Attachment requirement with uid [41ee5ebe-01b1-432c-b915-183d5fb6ef67popa] doesn't exist.","messageKey":"error.notFound.attachmentRequirementNotFound","message":"[error.notFound.attachmentRequirementNotFound]","code":404,"name":"Resource Not Found"}
Can you send the package JSON to [email protected] so that I can have a closer look at your package setup? You could follow below two steps:
(1)Log onto your sender portal (e.g. https://sandbox.esignlive.com/a/login)
(2)Once you get a session, open a new tab and hit this link: https://sandbox.esignlive.com/api/packages/t-7Yt2FLAruJWcik9dd2ESFV28s=
Reply to: how to download a attachment via JAVA SDK call when the package is complete
Friday, July 3, 2020 at 01:49pmHi Wendy,
Java SDK offers below functions:
//Download A single attachment (requires the attachment id)
DownloadedFile downloadedAttachment = client.getAttachmentRequirementService().downloadAttachmentFile(packageId, attachmentId);
Files.saveTo(downloadedAttachment.getContents(), downloadedAttachment.getFilename());
//Download All attachments in a package
DownloadedFile downloadedAllAttachmentsForPackage = client.getAttachmentRequirementService().downloadAllAttachmentFilesForPackage(packageId);
Files.saveTo(downloadedAllAttachmentsForPackage.getContents(), "downloadedAllAttachmentsForPackage.zip");
//Download All attachments from a particular signer
DownloadedFile downloadedAllAttachmentsForSigner1InPackage = client.getAttachmentRequirementService().downloadAllAttachmentFilesForSignerInPackage(myPackage, signer1);
Files.saveTo(downloadedAllAttachmentsForSigner1InPackage.getContents(), "downloadedAllAttachmentsForSigner.zip");
Duo
Reply to: Hi Wendy, Java SDK…
Friday, July 3, 2020 at 01:56pmGot it! Thanks Duo!
Wendy
Reply to: Got it! Thanks Duo! Wendy
Thursday, July 16, 2020 at 03:58pmHi Duo,
when create package with attachment with the below code:
.withSigner(newSignerWithEmail("[email protected]")
.withFirstName("John")
.withLastName("Doe")
.withCustomId("Signer1")
.withAttachmentRequirement(newAttachmentRequirementWithName("Driver's license")
.withDescription("Please upload a copy of your driver’s license.")
.isRequiredAttachment()
.build()))
when download the attachment with the below code, how to find attachment id?
//Download A single attachment (requires the attachment id)
DownloadedFile downloadedAttachment = client.getAttachmentRequirementService().downloadAttachmentFile(packageId, attachmentId);
Files.saveTo(downloadedAttachment.getContents(), downloadedAttachment.getFilename());
Thanks
Wendy
Reply to: how to download a attachment via JAVA SDK call when the package is complete
Friday, July 17, 2020 at 08:56amHi Wendy,
Try to create the AttachmentRequirement object separately:
AttachmentRequirement attachmentRequirement = AttachmentRequirementBuilder.newAttachmentRequirementWithName("Driver's license")
.withDescription("Please upload a copy of your driver’s license.")
.isRequiredAttachment()
.build();
attachmentRequirement.setId("myAttachmentId");
DocumentPackage superDuperPackage = newPackageNamed("Example Package")
.withSigner(newSignerWithEmail("")
.withFirstName("firstName2")
.withLastName("lastName2")
.withAttachmentRequirement(attachmentRequirement)
)
......
Duo
Reply to: Hi Wendy, Try to create…
Friday, July 17, 2020 at 01:53pmThanks Duo, Any size limitation for each attachment? is there a number limitation regarding to how many attachments can be included in a package?
Thanks
Wendy
Reply to: how to download a attachment via JAVA SDK call when the package is complete
Thursday, June 24, 2021 at 09:42pmHi Duo!
I was facing a similar issue and take the AttachmentRequirement creation using a custom id.
In what state should the transaction be to get the attachement downloaded by the custom id?
I've created a transaction with id t-7Yt2FLAruJWcik9dd2ESFV28s=, but when try to download, get an 404 exception:
Thanks in advance.
RC.
Reply to: Hi Duo! I was facing a…
Monday, June 28, 2021 at 08:56amHi rodrigo,
Can you send the package JSON to [email protected] so that I can have a closer look at your package setup? You could follow below two steps:
(1)Log onto your sender portal (e.g. https://sandbox.esignlive.com/a/login)
(2)Once you get a session, open a new tab and hit this link: https://sandbox.esignlive.com/api/packages/t-7Yt2FLAruJWcik9dd2ESFV28s=
Duo
Reply to: how to download a attachment via JAVA SDK call when the package is complete
Tuesday, June 29, 2021 at 08:29amHi Duo.
Email sent
Cheers.