Validate a licence key
One POST to /apps/{appId}/licenses/authenticate. Java 11+. No dependencies.
import java.net.URI;
import java.net.http.*;
var appId = System.getenv("EVORA_APP_ID");
var body = """
{"licenseKey": "%s"}
""".formatted(licenseKey);
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.evora.lol/api/developer-api/apps/" + appId + "/licenses/authenticate"))
.header("Authorization", "Bearer " + System.getenv("EVORA_API_KEY"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
// response.body() is JSON: { "authenticated": true, "subscription": { ... } }