This SDK allows you to easily integrate the Offisante eSignature API into your Java application.
Add the following dependency to your pom.xml
file:
<dependency>
<groupId>fr.lecomptoirdespharmacies</groupId>
<artifactId>offisante-esignature-java-sdk</artifactId>
<version>0.1.0</version>
<scope>compile</scope>
</dependency>
Add the following dependency to your build.sbt
file:
libraryDependencies += "fr.lecomptoirdespharmacies" % "offisante-esignature-java-sdk" % "0.1.0"
Add the following dependency to your build.gradle
file:
implementation 'fr.lecomptoirdespharmacies:offisante-esignature-java-sdk:0.1.0'
You need to configure the SDK with your Offisante eSignature API credentials. You can do this by creating a OffisanteESignatureApi
object:
String userName = "xxx";
String password = "yyy";
String environment = Configuration.ENV.DEV;
OffisanteESignatureApi offisanteEsignatureApi = new OffisanteESignatureApi(userName, password, environment);
You can create a document request by calling the createDocument
method:
try{
CreateDocumentRequest documentRequest = new CreateDocumentRequest()
.email("[email protected]")
.firstName("first")
.lastName("last")
.phone("0568999745");
String documentURL = offisanteEsignatureApi
.getDocumentService()
.createDocument(
documentRequest
);
}catch(DocumentAlreadyExistsException e){
// Handle exception
}catch(DocumentCreationException e){
// Handle exception
}
You can get a document status by calling the getDocumentStatus
method:
try{
DocumentStatus documentStatus = offisanteEsignatureApi
.getDocumentService()
.getDocumentStatus(documentId);
}catch(DocumentNotFoundException e){
// Handle exception
}