import java.net.URI; import java.net.http.*; import java.time.Duration; public final class TrustedSicClient { public static void main(String[] args) throws Exception { String token = System.getenv("TOKEN"); if (token == null) throw new IllegalStateException("Set TOKEN"); String json = "{\"signer\":{\"subject\":\"demo-user\"},\"documents\":[],\"profileId\":\"illustrative-profile\"}"; HttpRequest req = HttpRequest.newBuilder(URI.create("https://sandbox.quantumsafe.mobile-id.vn/v1/signing-requests")) .timeout(Duration.ofSeconds(30)).header("Authorization", "Bearer " + token) .header("Content-Type", "application/json").header("X-Correlation-Id", "00000000-0000-4000-8000-000000000001") .header("Idempotency-Key", "java-demo-001").POST(HttpRequest.BodyPublishers.ofString(json)).build(); HttpResponse res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString()); System.out.println(res.statusCode() + "\n" + res.body()); } }