Reply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 03:22am
0
votes
I apologize if it wasn't clear in the API documentation. When creating a new package, you have the option of setting the expiry date. An example is shown in "Custom Package Data" in the "Document Package Configuration" section of the API documentation.
DocumentPackage superDuperPackage1 = newPackageNamed( "Policy " + new SimpleDateFormat( "HH:mm:ss" ).format( new Date() ) )
.describedAs( "This is a package created using the e-SignLive SDK" )
.expiresAt( new Date() )
.withEmailMessage( "This message should be delivered to all signers" )
.withSigner( newSignerWithEmail( "[email protected]" )
.withCustomId( "Client1" )
.withFirstName( "John" )
.withLastName( "Smith" )
.withTitle( "Managing Director" )
.withCompany( "Acme Inc." ) )
.withDocument( newDocumentWithName( "First Document" )
.fromStream( new java.io.FileInputStream(DOCUMENT_PATH), DocumentType.PDF )
.withSignature( signatureFor( "[email protected]" )
.onPage( 0 )
.withField( FieldBuilder.checkBox()
.onPage( 0 )
.atPosition( 400, 200 )
.withValue( "x" ) )
.atPosition( 100, 100 ) ) )
.withAttributes(newDocumentPackageAttributes()
.withAttribute( "First Name", "Bill" )
.withAttribute("Last Name", "Johnson")
.withAttribute("Signing Order", "1")
.build())
.build();
PackageId packageId = eslClient.createPackage( superDuperPackage );
eslClient.sendPackage( packageId );
In the sample code I provided earlier, I set the expiry date on an already created package. It is indeed not covered in the documentation.
Reply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 02:46am
0
votes
It is definitely possible to set the expiry date with the Java SDK. The sample code below sets the expiry date to two weeks from today:
public class expiryDate {
public static final String API_KEY = "your_api_key";
public static final String API_URL = "https://sandbox.esignlive.com/api";
// USE https://apps.e-signlive.com/api FOR PRODUCTION
public static void main( String[] args ) {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, +14);
Date expiryDate = cal.getTime();
//connect to e-SignLive
EslClient eslClient = new EslClient( API_KEY, API_URL );
//create a packageId using your packageId string
PackageId packageId = new PackageId("472b7114-9478-493d-bd3c-2367a0cdab4e");
//get your package
DocumentPackage myPackage = eslClient.getPackage(packageId);
myPackage.setExpiryDate(expiryDate);
eslClient.getPackageService().updatePackage(packageId, myPackage);
}
}
Reply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 03:29am
0
votes
Ok thanks! I searched for keywords like expiry / reminder... And then found only explanation text saying this was an existing feature without code snippet... Thanks again!
Reply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 03:22amReply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 02:46amReply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 03:09amReply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 03:29amReply to: Set the package expiry date programmaticaly
Monday, December 14, 2015 at 03:36am