e-Contracts Web Service Client

This library provides an implementation of the client side of the e-Contracts Web Service.

This library can be used to:

  • Create an electronic contract.
  • Check the signature status on an electronic contract.
  • Download the final contract.

A contract is considered final if all recipients have signed the contract.

The client library is available within the e-contract.be Maven repository. Configure this Maven repository within your pom.xml as follows:

<repositories>
        <repository>
                <id>e-contract.be</id>
                <url>https://www.e-contract.be/maven2/</url>
        </repository>
</repositories>

Add the client library within your pom.xml dependencies element as follows:

<dependency>
        <groupId>be.e_contract.e_contracts.e-contracts-service</groupId>
        <artifactId>e-contracts-service-client</artifactId>
        <version>0.2.0</version>
</dependency>

Initialize the client

The application identifier and application secret can be retrieved by self registration of your application. Register your application via the e-Contracts portal.

EContractsServiceClient client = new EContractsServiceClient("https://www.e-contract.be/contracts/ws");
client.setCredentials("the-application-identifier", "the-application-secret-hex-encoded");

Creating an electronic contract

String title = "contract title";
byte[] pdfDocument = ...;
Set<String> recipients = new HashSet<String>();
recipients.add("info@e-contract.be");
recipients.add("sales@e-contract.be");
long contractIdentifier = client.createContract(title, "document-filename.pdf", pdfDocument, recipients);

Query all your contracts

List<Long> contractIdentifiers = client.getContractIdentifiers(false);

To query all contract that are in their final stage (i.e., all recipients have signed):

List<Long> finalContractIdentifiers = client.getContractIdentifiers(true);

Get contract details

ContractDetailsResponseType contractDetails = client.getContractDetails(contractIdentifier);

Download a contract

byte[] download = client.downloadContract(contractIdentifier);

Remove a contract

client.removeContract(contractIdentifier);

Poke recipients

To poke all recipients that did not yet sign the contract:

client.pokeRecipients(contractIdentifier);

Javadoc API documentation

Javadoc API documentation