|
|
# API Usage
|
|
|
|
|
|
## Maven Repository
|
|
|
In order to use our API you have to add our companies Maven repository to your Maven project's POM:
|
|
|
|
|
|
<project ...>
|
|
|
...
|
|
|
|
|
|
<repositories>
|
|
|
<!-- Capitol Inc. repository -->
|
|
|
<repository>
|
|
|
<id>capitol</id>
|
|
|
<url>http://camunda-capitol.iwvi.uni-koblenz.de:88</url>
|
|
|
</repository>
|
|
|
</repositories>
|
|
|
|
|
|
...
|
|
|
</project>
|
|
|
|
|
|
## Make Client Calls
|
|
|
Once you added our repository, you can use our clients to call our API.
|
|
|
There is no need of managing HTTP connections and requests yourself.
|
|
|
However, if you want to implement this on your own, our [API documentation](api-documentation) should be what you need.
|
|
|
|
|
|
There are two clients that you can use:
|
|
|
1. a contract client for the contracting process
|
|
|
2. an accident client for the accident process
|
|
|
|
|
|
Both clients work with transaction keys:
|
|
|
You define a unique transaction key that is used to identify the process you have started or that you want to resume.
|
|
|
For additional API documentation, please have a look at the Java documentation of our classes.
|
|
|
|
|
|
### Contract API Client
|
|
|
With the [contract API client](../blob/develop/src/main/java/de/uniko/digicom/capitol/api/client/ContractApiClient.java) you can
|
|
|
* start the contracting process
|
|
|
* send the customer decision regarding the contracting
|
|
|
|
|
|
#### Start Contracting
|
|
|
|
|
|
ContractApiClient contractClient = new ContractApiClient();
|
|
|
ContractRequest contractRequest = new ContractRequest("transactionKey");
|
|
|
Signer signer = new Signer("customerId", "driverLicenseId");
|
|
|
contractRequest.setSigner(signer);
|
|
|
|
|
|
boolean success =
|
|
|
contractClient.startContracting(contractRequest);
|
|
|
if (success) {
|
|
|
System.out.println("Contract process has been started.");
|
|
|
}
|
|
|
|
|
|
#### Send Customer Decision
|
|
|
|
|
|
### Accident API Client
|
|
|
With the [accident API client](../blob/develop/src/main/java/de/uniko/digicom/capitol/api/client/AccidentApiClient.java) you can
|
|
|
* start the accident process
|
|
|
* send a repair invoice
|
|
|
|
|
|
#### Start Accident Claiming
|
|
|
#### Send Repair Invoice |