mailtodanish | Posts: 47

How to add Signer and Document in Existing Package.

0 votes
Hi, I want to create a package and have to add Signers and Documents later on same package. Thanks,

Approved Answer
Duo_Liang | Posts: 3776

Reply to: How to add Signer and Document in Existing Package.

0 votes
Hi there, Please refer to this code snippet:
		//step 1: create a package and create it with status of "DRAFT"
		DocumentPackage newPackage = newPackageNamed("Create package + Add Signers and Docs")
				.describedAs("xxxxxxx")
				.build();
		
		PackageId createPackage = eslClient.createPackage(newPackage);
		System.out.println(createPackage);
		
		
		//step 2: add signers
		Signer signer1 = SignerBuilder.newSignerWithEmail("[email protected]")
				.withFirstName("John")
				.withLastName("Smith")
				.withCustomId("Signer1")
				.build();
		
		Signer signer2 = SignerBuilder.newSignerWithEmail("[email protected]")
				.withFirstName("Mary")
				.withLastName("Doe")
				.withCustomId("Signer2")
				.build();
		
		eslClient.getPackageService().addSigner(createPackage, signer1);
		eslClient.getPackageService().addSigner(createPackage, signer2);
		
		
		//step 3: add documents and use .withSignature() function or extraction methods to place signatures/fields
		Document document1 = DocumentBuilder.newDocumentWithName("document1")
				.fromFile(FILE_PATH)
				.withId("document1")
				.withDescription("Sample Document Description")
				.build();
		
		Document document2 = DocumentBuilder.newDocumentWithName("document2")
				.fromFile(FILE_PATH2)
				.withId("document2")
				.withDescription("Sample Document Description")
				.build();
		
		
		eslClient.getPackageService().uploadDocuments(createPackage.getId(), Arrays.asList(document1,document2));
		
		//step4: send package when it's ready
		//eslClient.sendPackage(createPackage);
Which contains four steps: step 1: create a package and create it with status of "DRAFT" step 2: add signers step 3: add documents and use .withSignature() function or extraction methods to place signatures/fields step4: send package when it's ready Hope this could help! Duo

mailtodanish | Posts: 47

Reply to: How to add Signer and Document in Existing Package.

0 votes
Hi, Is it possible if we can set Sender detail as well. we have to send document to clients but need to capture Agent (Sender) detail. ThankS

Duo_Liang | Posts: 3776

Reply to: How to add Signer and Document in Existing Package.

0 votes
Hi, You can use below code to set sender info, aka, "send on behalf of your sender":
	
DocumentPackage superDuperPackage = PackageBuilder.newPackageNamed("package_name")
				.withSigner(
                                                      ...
						)
				.withDocument(
                                                    ...
                                                )
				.withSenderInfo(SenderInfoBuilder.newSenderInfo("your_sender_email")
						.withName("sender_firstname", "sender_lastname")
						.withCompany("sender_company")
						.withTitle("sender_title")
						.withTimezoneId("sender_timezoneid")
						)
                                  ...
				.build();
Because you are sending on behalf of your sender, 1. the sender has to be already invited to your account owner 2. and the sender email in the code needs to match with your sender's Hope this could help! Duo

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off