Java SDK

JVM client for Spring Boot and enterprise services that need governed document output.

Install

xml
<dependency>
  <groupId>com.commspliant</groupId>
  <artifactId>sdk</artifactId>
  <version>0.2.0</version>
</dependency>

Links

Quickstart

Render an approved template to HTML:

java
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:

Use renderHtml / renderPdf (or language-specific naming) on the client. See the GitHub repository for full documentation and PDF examples.

Back to SDK overview