This package is a JAVA wrapper around the Signaturit API. If you didn't read the documentation yet, maybe it's time to take a look here.
You'll need at least JAVA 1.7 to use this package.
The recommended way to install the SDK is through Maven.
Add the dependencies to your pom.xml :
<dependency>
<groupId>com.signaturit.api</groupId>
<artifactId>java-sdk</artifactId>
<version>1.2.1</version>
</dependency>
or Gradle.
compile 'com.signaturit.api:java-sdk:1.2.1'
Then import the library and instantiate the Client class passing in your API access token.
Client client = new Client("YOUR_ACCESS_TOKEN");
Please note that by default the client will use our sandbox API. When you are ready to start using the production environment just get the correct access token and pass an additional argument to the constructor:
Client client = new Client("YOUR_ACCESS_TOKEN", true);
All Client's methods will return a object of Response class.
Example: Print body result as String.
Response response = client.countSignatures();
System.out.println(response.body().string());
Retrieve all data from your signature requests using different filters.
response = client.getSignatures();
response = client.getSignatures(50);
HashMap<String, Object> filters = new HashMap<String,Object>();
filters.put("crm_id", "customId");
response = client.getSignatures(10, 100, filters);
Count your signature requests.
HashMap<String, Object> filters = new HashMap<String,Object>();
filters.put("crm_id", "customId");
response = client.countSignatures(filters);
Get the information regarding a single signature request passing its ID.
response = client.getSignature("signatureId");
Create a new signature request. You can check all signature params.
ArrayList<File> files = new ArrayList<File>();
File file = new File("/documents/contracts/receipt250.pdf");
files.add(file);
ArrayList<HashMap<String, Object>> recipients = new ArrayList<HashMap<String,Object>>();
HashMap<String, Object> recipient= new HashMap<String, Object>();
recipient.put("email", "john.doe@example.com");
recipient.put("fullname", "John Doe");
recipients.add(recipient);
HashMap<String, Object> options= new HashMap<String, Object>();
options.put("subject", "Receipt no. 250");
options.put("body", "please sign the receipt");
response = client.createSignature(files, recipients, options);
You can send templates with the fields filled
//you can add multiple templates
ArrayList<String> templates = new ArrayList<String>();
templates.add("templateName");
options.put("templates", templates);
response = client.createSignature(null, recipients, options);
Cancel a signature request.
response = client.cancelSignature("signatureId");
Send a reminder email.
response = client.sendSignatureReminder("signatureId");
Get the audit trail of a signature request document and save it locally.
response = client.downloadAuditTrail("signatureId", "documentId");
Get the signed document of a signature request document and save it locally.
response = client.downloadSignedDocument("signatureId", "documentId");
Get all account brandings.
response = client.getBrandings();
Get a single branding.
response = client.getBranding("brandingId");
Create a new branding. You can check all branding params.`
HashMap<String, Object> applicationText = new HashMap<String, Object>();
applicationText.put("sign_button", "test sign");
applicationText.put("send_button", "test send");
HashMap<String, Object> options = new HashMap<String, Object>();
options.put("application_texts", applicationText);
options.put("layout_color", "#FFBF00");
response = client.createBranding(options);
Update a single branding.
response = $client.updateBranding("brandingId", options);
Retrieve all (delimited by limit and offset) template data from your templates.
int limit = 100;
int offset = 0;
response = client.getTemplates(limit, offset);
####Get all certified emails
Retrieve all certified emails data.
response = client.getEmails();
####Get last 50 emails
int limit = 50;
response = client.getEmails(limit);
Count all certified emails.
response = client.countEmails();
Get a single email
response = client.getEmail('emailId');
Create a new certified email
ArrayList<File> files = new ArrayList<File>();
File fileToEmail = new File("/path/youPdf.pdf");
files.add(fileToEmail);
client.createEmail(files, recipients, "subject", "body");
Get the audit trail document of an email request and save it in the submitted path.
response = client.downloadEmailAuditTrail("emailId","certificateId");