Kernel::WebApp::Controller::Websocket

NAME

Kernel::WebApp::Controller::Websocket – Controller for websocket requests.

PUBLIC INTERFACE

Handler()

initializes websocket connections, and routes REST over websocket messages to "DispatchREST()".

Please see also Kernel::WebApp::Plugin::2200InitializeWebsocketConnections for further logic that is applied to all established websocket connections, such as an active heartbeat check.

DispatchREST()

HTTP/REST over websocket handler.

This is used to talk to the REST backend API through normal websocket messages: the client sends a message that looks like an HTTP request, it is unwrapped, dispatched normally, and the result is sent back via another websocket message that carries the same RequestID field to indicate which request it originated from.

Request payload example (decoded):

    (
        Path      => "customer/ticket/list",
        Method    => "GET",
        RequestID => 6,
        Headers   => {
            Authentication => "Bearer [...]"
        }
        Body => { ... }
    )

Response payload example (not yet encoded):

    (
        Path      => "customer/ticket/list",    # mirrored from request, used for handler filtering in the front end
        Method    => "GET",                     # mirrored from request, used for handler filtering in the front end
        RequestID => 6,                         # mirrored from request, used for handler filtering in the front end
        Code      => 200,
        Message   => 'OK'
        Headers   => {
            Content-Type         => "application\/json;charset=UTF-8",
            "X-OTRS-API-Version" => "1.0.0",
        }
        Body => { ... }

    )
Scroll to Top