Java SDK
JVM client for Spring Boot and enterprise services that need governed document output.
Install
<dependency>
<groupId>com.commspliant</groupId>
<artifactId>sdk</artifactId>
<version>0.2.0</version>
</dependency>Links
Quickstart
Render an approved template to HTML:
import com.commspliant.sdk.CommsPliantClient;
import com.commspliant.sdk.RenderRequest;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Map;
public class Example {
public static void main(String[] args) throws Exception {
CommsPliantClient client = new CommsPliantClient("ck_YOUR_API_KEY");
var result = client.renderHtml(RenderRequest.builder()
.templateId("550e8400-e29b-41d4-a716-446655440000")
.variables(Map.of(
"title", "Monthly Report",
"user", Map.of("name", "Jane Doe")
))
.build());
Files.write(Path.of("document.html"), result.getBody());
}
}API endpoints
The SDK supports both Customer Integration API render endpoints:
- POST /api/v1/render/html— render template to HTML
- POST /api/v1/render/pdf— render template to PDF
Use renderHtml / renderPdf (or language-specific naming) on the client. See the GitHub repository for full documentation and PDF examples.