Java SDK
The Fatture in Cloud Java SDK is a Java library that offers models and methods to interact with the Fatture in Cloud v2 REST API.
If you want to know more generic information about our SDKs, please check the SDK Overview page.
☑️ Requirements and Dependencies
This SDK can be used in Java applications. It is mainly based on the OkHttp client.
⬇️ Download and Installation
The SDK code and detailed documentation can be found in the GitHub repository.
Make sure you always import the newest version of our SDK, you can check which version is the latest on the Maven Central Repository
The SDK can be installed by adding the dependency in your project pom.xml
<dependency>
<groupId>it.fattureincloud</groupId>
<artifactId>fattureincloud-java-sdk</artifactId>
<version>VERSION</version>
</dependency>
or in your build.gradle file
repositories {
mavenCentral()
}
dependencies {
implementation "it.fattureincloud:fattureincloud-java-sdk:VERSION"
}
If you want to use another build tool (for example SBT) you can check on the Maven Central Repository or MvnRepository.
👷 SDK Structure
Our SDK is mainly split into two different packages:
- api: Here you can find the implementation of our API methods, you will need to initialize one of those APIs to start.
- model: This package contains all the representations of our API requests and responses; when using one of the methods above, you'll have to manage some of those models.
There are some models with a special role:
- The models with a name ending for Request can be used as request body for one of our methods.
- The models with a name ending for Response will be returned after the execution of one of the methods. The other models will be used to compose the content of the requests or responses for our methods.
You can think about Request and Response as wrappers: each one of them is dedicated to a single method of the API, and they will most of the time contain a single attribute called data, that contains the real body of the request or the response represented through a composition of the other models. Each method will accept at most one Request model and will return at most one Response model.
Let's take for example the Modify Supplier method.
It is included in the SuppliersApi, it accepts one ModifySupplierRequest and it returns a ModifySupplierResponse. In both cases, the data parameter will contain a Supplier, that represents the modifies to apply to the supplier (for the request) and the final status of the supplier (for the response).
In contrast, the List Suppliers method is still contained in the SuppliersApi, but it doesn't need any request body and returns a single ListSuppliersResponse, where the data parameter will contain an array of Suppliers.
📢 API calls
The API methods can be categorized as follows:
Category (prefix) | Request Body | Response Body | Notes |
---|---|---|---|
List (list) | ❌ | ✅ | 🎩 + |