|
|
# API Usage
|
|
|
|
|
|
## Maven Repository
|
|
|
In order to use our API you have to add our companies Maven repository to your Maven project's POM:
|
|
|
## Setup
|
|
|
There are two steps necessary in order to use our API in one of your projects.
|
|
|
Both steps are changes in your Maven project's POM.
|
|
|
|
|
|
1. add the Capitol Inc. repository
|
|
|
1. add the Capitol Inc. API dependency
|
|
|
|
|
|
At first add our Maven repository to your project's POM:
|
|
|
|
|
|
<project ...>
|
|
|
...
|
... | ... | @@ -17,14 +23,38 @@ In order to use our API you have to add our companies Maven repository to your M |
|
|
...
|
|
|
</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.
|
|
|
Now Maven will be able to resolve dependencies developed by Capitol Inc.
|
|
|
Thus we can add the Capitol Inc. API dependency safely:
|
|
|
|
|
|
<project ...>
|
|
|
...
|
|
|
|
|
|
<dependency>
|
|
|
<groupId>de.uniko.digicom.capitol</groupId>
|
|
|
<artifactId>capitol-api</artifactId>
|
|
|
<version>0.0.1-SNAPSHOT</version>
|
|
|
</dependency>
|
|
|
|
|
|
...
|
|
|
</project>
|
|
|
|
|
|
Note:
|
|
|
**The API is still in development.**
|
|
|
There may be multiple versions available in future.
|
|
|
You can use our Maven [API artifact page]() to check for the latest version.
|
|
|
|
|
|
As long as you stick with one version, existing API functionality won't change.
|
|
|
However, additional functionality may be implemented.
|
|
|
|
|
|
## Use our Clients
|
|
|
Once you made our API available in your project by adding its dependency, you can use our clients to call our API.
|
|
|
|
|
|
These clients wrap the management of HTTP connections and requests, there is no need to implement this 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
|
|
|
1. contract client - for the contracting process
|
|
|
1. 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.
|
... | ... | |