Generally, if you are using Interlok as an HTTP endpoint, then you would just use one of the standard HTTP consumers as part of a normal workflow (Servicing HTTP requests); however, in certain situations it can be useful to expose an arbitrary workflow (e.g. a JMS bridge) so that you can inject messages into the workflow without doing additional configuration. This requires that you enable the built-in jetty instance, and the new “rest” management component.

Enabling the built-in Webserver and REST components

With a factory installation of Interlok, the embedded web server should already be enabled by default. This can be checked in the for the “managementComponents” property.

All enabled management components are listed, separated by colon’s as the value to the “managementComponents” property;


As shown above “jetty”, the embedded web server is enabled along with the “rest” component.

Installing the Restful Services Component

You will need three extra java archive (jar) files which will be dropped into your base Interlok installations “lib” directory;

  • interlok-restful-workflow-services.jar
  • interlok-client.jar
  • interlok-jmx-client.jar

You can obtain these jars either by;

  • building from source from our public github; AdaptrisGitHub
  • downloading from our public nexus; AdaptrisNexus
  • contacting our support team

Starting the restful services

Assuming you have the correct jar files and configuration in place as detailed above, you will see the following at debug level in the Interlok log files upon startup;

Restful Start

The final line above shows the restful services component has completed it’s initialization, you’re now ready to fire your requests.

Standard Interlok Restful Services

The API definition

There is a single http GET API endpoint that will return an OpenApi 3.0.1 API definition.

You can reach this definition with a HTTP GET to the root url of ; http://<host>:<port>/workflow-services/

The definition is dynamically built in OpenApi 3.0.1 yaml format to include all of your Interlok workflows; a brief example;

openapi: 3.0.1
  title: Interlok Workflow REST services
  description: A REST entry point into your Interlok workflows.
  version: "1.0"
  - url: 'http://yourhost:yourport'
      description: Post your message directly into your Interlok workflow.
              type: string
                value: MyMessageContent
          description: The response content after your workflow has processed the incoming message.
                type: string
                  value: MyMessageResponseContent
        - url: 'http://yourhost:yourport'
      - url: 'http://yourhost:yourport'

By pointing an OpenApi 3.0.1 tool to the definition url you can visualize the full API available for this instance of Interlok.

Shown below is an example of using Swagger as the OpenApi tool;

Swagger UI

Swagger, interprets the API definition and provides instant access to each workflow, via a http POST.

Injecting your messages into your Interlok workflows

In true restful style you will POST to the base url with all of the Interlok instance id, channel id and workflow id built into the full url;


The Interlok message content will be drawn from the body of your POST request.

Any http headers will be converted into Interlok message metadata.

Again using Swagger, we can test POST’ing a simple message directly into one of our workflows;

Swagger Post

If your message was successfully submitted to the workflow then you will get a http status 200 code response with the updated content as the body of the response.

Should your request fail or cause an error, you will receive a http status 400 code along with details of the error in the body of the response.