Example REST API Clients
The REST plug-in API provides a generic interface that allows building various applications interacting with MERLIC. The provided built-in web application shows how such an application might look like. To support you with building your own applications, MERLIC also provides some example REST API clients in different programming languages. The examples demonstrate different functionality for interacting with MERLIC. You can use the respective source code of the examples as template for your own applications and adjust them as desired.
The examples are provided in the directory "examples\rest_plugin_clients" within the MERLIC installation directory. The individual examples are stored in the respective subdirectories of the programming languages. Some of the examples are provided only for HTML. However, the logic of the individual examples can be transferred to other programming languages.
In the following, you can find general information on the available example REST API clients. For information on how to run the examples, see the description in the respective source code of the examples.
action_status
This example demonstrates how to send actions to the vision system and how to wait for their completion. In addition, it demonstrates how to start a single job and how to wait for the associated result.
This example is provided only in HTML.
execution_control
This example demonstrates how to monitor the current state of the state machine and how to control the execution without explicitly waiting for an action or job completion. It is written in a way that ensures robust handling of the vision system and server restarts.
This example is provided only in HTML.
halt_vision_system
This minimal example shows how to make an HTTP request to the REST plug-in server.
This example is provided in multiple programming languages.
result_images
This example demonstrates the use of the API endpoints for image results.
It polls for new results and will display a list of all the images in those results as thumbnails. It shows how size and quality of the images can be customized through query parameters. Additionally, this example demonstrates how to use the "x-event-session-id" header to detect and handle a reset of the API backend.
This example is provided only in HTML.