Skip to main content

REST API

Every module exposes its functions as a REST API, documented in the OpenAPI format.

Getting the OpenAPI document​

Once the launcher is running, the OpenAPI document is served at:

http://localhost:8090/q/openapi

It is generated in development mode only and is not served in production.

Documenting an endpoint​

Each endpoint is documented in the code with the MicroProfile OpenAPI annotations:

modules/techniques/directory/src/main/java/fr/tech/openent/directory/resource/TenantResource.java
@POST
@Path("/tenant")
@Operation(summary = "Create a tenant", description = "Returns a created tenant.")
@APIResponses(value = {
@APIResponse(responseCode = "201", description = "Successful, returns a tenant"),
})
@SecuredAction("tenant.create")
@IgnoreCsrf
public Uni<Response> create(final HttpServerRequest request) {
return Uni.createFrom().emitter(emitter -> {
bodyToJson(request, DefaultResourcePath.DIRECTORY_HTTP_ROOT_PATH + "/createTenant", event -> {
tenantService.create(event, result -> {
if (result.isRight()) {
emitter.complete(Response.status(201).entity(result.isRight()).build());
} else {
emitter.fail(new RuntimeException("Failed to create tenant"));
}
});
});
});
}

@SecuredAction names the action that a role must hold to call the endpoint.

Module paths and ports​

Each module is served under its own path. In development, everything is reached through port 8090 and forwarded to the module.

ModulePathDefault port
Application registry/appregistry8012
Directory/directory8003
Administration console/admin8089
Portal/themes8017
Document space/workspace8011
Communication/communication8015

The ports are the container defaults and may differ in your deployment.

Two modules also have their own administration screens:

ModulePath
Application registry/appregistry/admin-console
Directory/directory/admin-console

HTTP headers​

HeaderPurpose
X-ENT-ThemeSelects the theme for the request
X-Forwarded-HostRouting between modules, set by the HTTP proxy
X-Forwarded-ForRouting between modules, set by the HTTP proxy