Last updated
Last updated
The SDK is mostly generated from the OpenAPI specification. You can read the API documentation here:.
This means that the API is fully covered, including all endpoints used by the frontend. You can also use the SDK to create and configure Apps, schemas and rules.
Use this SDK in your Java application to integrate with Squidex CMS.
The SDK is available on . The installation depends on your build system.
Add the dependency in your build.gradle
:
Add the dependency in your pom.xml:
The SquidexClient
is the main entry point for the SDK. It provides the properties for all endpoints.
You can instantiate the client using the following code snippet:
The url
parameter is optional if you are using Squidex Cloud.
Configure a timeout in seconds to cancel unresponsive requests.
The default timeout is 30 seconds.
The SDK uses the client ID and the client secret to acquire a bearer token, and handles invalidation and expiration automatically. By default the token is stored inside the client and therefore a new token is acquired when the client is cleaned by the garbage collector. However, one can define where the token is stored.
By default the certificates are validated. But for test environments it might be necessary to connect to instances with self signed certificates only. Therefore we have introduced an option to ignore the certificate chain:
To use the client you have to use the correct property.
For example, to create a schema use the schemas
property.
In order to work with contents, use the contents
property.
The SDK uses exceptions for error handling.
Refer to the code snippet below for an example:
As of this writing, the SDK has the following limitations:
Endpoints to download files (e.g. assets) return a stream only and not metadata information like the content type or the content length.
Endpoints to download files work for Node only and are not available in the browser. This is generally not an issue as assets are handled via direct links in the browser.
The generated builders all follow the staged builder pattern. For untyped data, e.g. content items the builder is not available yet and you have to construct the data structure manually using hash maps and arrays.
Deprecated methods and properties are not annotated yet.
In this article, we will cover some of the important configuration values only. The client is based on the library to support all platforms including Android. Therefore many configuration options are available throug passing a custom client to Squidex. This client gets cloned to make customizations, for example for authentication.
Read more:
Easy installation and setup of the Java SDK.