Documentation Index

Fetch the complete documentation index at: https://docs.lobster-world.com/llms.txt

Use this file to discover all available pages before exploring further.

REST API: Action block context

Prev Next

This topic describes the action block context of a REST API endpoint: declared variables, return value and response type, and endpoint-specific aspects of anonymous access. For an overview of the REST API configuration, see REST API.

Declared variables (tree view)

The tree view to the left of the action block reflects, in its upper area, selected characteristics of the data structure for the endpoint definition.

As the last element of the top hierarchy level, the Declared variables node appears. It lists all variables for the action block including type hints.

The following variables are declared by the system. You access them in the action block via the Variable value resolver.

NOTE If the node contains further declared variables, these originate from configurations in the action block or from the URI definition of the endpoint (see REST API: URI and URI parameters).

TIP During configuration, the tree view partially updates only once you touch the tree. Changed URI parameters, however, appear immediately after you leave the field.

Variable name

Type

Description

Direction

requestHeaders

Map

All request headers as a map that assigns String values to String keys.

Inbound

queryParameters

Map

All query parameters from the URL as a map that assigns String values to String keys.

Inbound

response

Object

Data object for the return value.

Outbound

responseCode

int

HTTP response status code for the reply. Default on success: 200.

Outbound

responseHeaders

Map

User-defined response headers as a map that assigns String values to String keys.

Outbound

disableContentHandling

Boolean

Controls the handling of a Content object as the return value. With false (default), the platform returns the payload of a Content object assigned to the response variable. With true, it serializes the Content object like any other object, for example as JSON.

Outbound

forceDownload

Boolean

Only relevant when disableContentHandling is false and response is a Content object. With false (default), the platform sets the Content-Disposition header to inline. The content is returned directly. With true, it sets the header to attachment. The content is downloaded.

Outbound

Return value and response type

You define the regular return value of an endpoint in the action block by assigning it to the response variable.

The serialization of this data object, specifically the response type, is by default determined by the Accept header in the request.

 EXCEPTION  If you assign an object of type Content (Content) to the response variable, no automatic serialization takes place. Instead, the platform returns the payload of the Content object. This way, you return any amount of data via File reference, for example. The platform takes the Content-Type header from the mediaType field of the Content object.

NOTE You override this special handling of the Content type by assigning true to the disableContentHandling variable in the action block (see table above).

Anonymous vs. authorized access

For each endpoint, you decide individually via the Anonymous access option (allowAnonymousAccess) whether access without authorization is possible.

The general rules and the platform's behavior for anonymous and authenticated access are described in Access control for APIs. This section only adds the endpoint-specific aspects.

 CAUTION  A Search (Event action) with a Role of session without owner restrictions, such as a "Super User" role, is a security risk. This could allow the anonymous endpoint to grant read access to sensitive data without access control.

IMPORTANT

If you access an endpoint from the same browser in which a Lobster Data Platform session is already running, the session cookie automatically takes effect. The call then inherits the existing session context. For genuine anonymous tests, use a private browser window or a REST client independent of the logged-in browser.

Otherwise, you authenticate via OAuth2 for API access.