### Starting a Process with Process and Sub-table Data Source: https://docs.jobrouter.com/2026.1/de/developer/restapi_vorgangstarten.html This example demonstrates how to start a JobRouter process and pass data for both main process fields and nested sub-tables. It includes setting a step, summary, escalation date, and populating fields and attachments for a sub-table. ```php 'step', 'contents' => '1', ], [ 'name' => 'summary', // Process subject 'contents' => 'Vorgang gestartet über REST API', ], [ 'name' => 'step_escalation_date', // Step escalation 'contents' => '2017-10-12T11:00:00+01:00', ], [ 'name' => 'processtable[fields][0][name]', 'contents' => 'INVOICENR', ], [ 'name' => 'processtable[fields][0][value]', 'contents' => 'IN02984', ], [ 'name' => 'processtable[fields][1][name]', 'contents' => 'INVOICE_DATE', ], [ 'name' => 'processtable[fields][1][value]', 'contents' => '2017-08-29T00:00:00+01:00', ], [ 'name' => 'processtable[fields][2][name]', 'contents' => 'AMOUNT', ], [ 'name' => 'processtable[fields][2][value]', 'contents' => '12000.78', ], [ 'name' => 'processtable[fields][3][name]', 'contents' => 'INVOICE_FILE', ], [ 'name' => 'processtable[fields][3][value]', 'contents' => fopen('/path/to/invoice/file.pdf', 'r'), ], [ 'name' => 'subtables[0][name]', 'contents' => 'SINVOICE_ATTACHMENTS' // Name of a sub-table ], [ 'name' => 'subtables[0][rows][0][fields][0][name]', 'contents' => 'ATT_IN_DATE', // first row of the sub-table begins here ], [ 'name' => 'subtables[0][rows][0][fields][0][value]', 'contents' => '2017-09-02T14:30:00+01:00', ], [ 'name' => 'subtables[0][rows][0][fields][1][name]', 'contents' => 'ATT_FILE', ], [ 'name' => 'subtables[0][rows][0][fields][1][value]', 'contents' => fopen('/path/to/attachment/note.txt', 'r'), ], [ 'name' => 'subtables[0][rows][1][fields][0][name]', 'contents' => 'ATT_IN_DATE', // second row begins here ], [ 'name' => 'subtables[0][rows][1][fields][0][value]', 'contents' => '2017-09-06T11:28:43+01:00', ], ]; // The actual API call would follow, using a client like GuzzleHTTP // Example: $client->post('/application/incidents/yourProcessName', ['multipart' => $input]); ?> ``` -------------------------------- ### Start Process Incident with Process and Sub-table Data Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?restapi_vorgangstarten.html= This example demonstrates how to start a process incident by sending data for both the main process fields and nested sub-tables. It uses the Guzzle HTTP client to make a POST request to the /application/incidents/:processName endpoint. ```php 'step', 'contents' => '1', ], [ 'name' => 'summary', // Prozessbetreff 'contents' => 'Vorgang gestartet über REST API', ], [ 'name' => 'step_escalation_date', // Schritteskalation 'contents' => '2017-10-12T11:00:00+01:00', ], [ 'name' => 'processtable[fields][0][name]', 'contents' => 'INVOICENR', ], [ 'name' => 'processtable[fields][0][value]', 'contents' => 'IN02984', ], [ 'name' => 'processtable[fields][1][name]', 'contents' => 'INVOICE_DATE', ], [ 'name' => 'processtable[fields][1][value]', 'contents' => '2017-08-29T00:00:00+01:00', ], [ 'name' => 'processtable[fields][2][name]', 'contents' => 'AMOUNT', ], [ 'name' => 'processtable[fields][2][value]', 'contents' => '12000.78', ], [ 'name' => 'processtable[fields][3][name]', 'contents' => 'INVOICE_FILE', ], [ 'name' => 'processtable[fields][3][value]', 'contents' => fopen('/path/to/invoice/file.pdf', 'r'), ], [ 'name' => 'subtables[0][name]', 'contents' => 'SINVOICE_ATTACHMENTS' // Name einer Untertabelle ], [ 'name' => 'subtables[0][rows][0][fields][0][name]', 'contents' => 'ATT_IN_DATE', ], [ 'name' => 'subtables[0][rows][0][fields][0][value]', 'contents' => '2017-09-02T14:30:00+01:00', ], [ 'name' => 'subtables[0][rows][0][fields][1][name]', 'contents' => 'ATT_FILE', ], [ 'name' => 'subtables[0][rows][0][fields][1][value]', 'contents' => fopen('/path/to/attachment/note.txt', 'r'), ], [ 'name' => 'subtables[0][rows][1][fields][0][name]', 'contents' => 'ATT_IN_DATE', ], [ 'name' => 'subtables[0][rows][1][fields][0][value]', 'contents' => '2017-09-06T11:28:43+01:00', ], [ 'name' => 'subtables[0][rows][1][fields][1][name]', 'contents' => 'ATT_FILE', ], [ 'name' => 'subtables[0][rows][1][fields][1][value]', 'contents' => fopen( '/path/to/another/attachment/confirmation.pdf', 'r' ), ], ]; try { // Vorgang mit den oben definierten Daten starten // (als multipart/form-data) $response = $client->request('POST', 'application/incidents/invoice', [ 'multipart' => $input, ] ); // Antwort bearbeiten echo "Status code: " . $response->getStatusCode() . "\n"; $body = $response->getBody(); ``` -------------------------------- ### startProcess Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?webservice_startprocess.html= Starts a new process instance for a given process. It can be specified whether the instance should start synchronously or asynchronously. The call returns a unique identifier for the started process instance. For a synchronous start, the process ID of the new instance is returned. For an asynchronous start, the task ID of the new instance is returned. ```APIDOC ## startProcess ### Description Starts a new process instance for a given process. It can be specified whether the instance should start synchronously or asynchronously. The call returns a unique identifier for the started process instance. For a synchronous start, the process ID of the new instance is returned. For an asynchronous start, the task ID of the new instance is returned. ### Method POST ### Endpoint /startProcess ### Parameters #### Request Body - **soProcessInstance** (ServiceObject_ProcessInstance) - Required - Process instance object - **soStepInstance** (ServiceObject_StepInstance) - Required - Step instance object - **asynchronous** (bool) - Optional - Flag indicating if the process start should be asynchronous. Defaults to false. - **taskId** (string) - Optional - Unique identifier for asynchronous process start. If no value is passed, a task ID will be automatically generated. ### Response #### Success Response (200) - **string** - Process ID for synchronous start, or Task ID for asynchronous start of the process. ``` -------------------------------- ### List Available Start Steps Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?restapi_boxen.html= Retrieves a list of all available steps that can be initiated by the authenticated user. ```APIDOC ## GET /application/workitems/start ### Description Lists available start steps for the authenticated user. ### Method GET ### Endpoint /application/workitems/start ### Response #### Success Response (200) - The response will be a JSON object containing a list of available start steps. The exact structure of the work items will be similar to the general inbox, with process-specific details. ### Request Example ```http GET /application/workitems/start HTTP/1.1 Host: example.org Authorization: Bearer YOUR_ACCESS_TOKEN ``` ``` -------------------------------- ### Example: Fetching Process Inbox Items Source: https://docs.jobrouter.com/2026.1/de/developer/restapi_referenz.html This example demonstrates how to call a specific route to retrieve process inbox items. It shows the full URL construction, including placeholders for process name, version, and inbox ID. ```http http://example.org/jobrouter/api/rest/v2/application/workitems/urlaub_beantragen/1/42 ``` -------------------------------- ### Start and End Session with cURL Source: https://docs.jobrouter.com/2026.1/de/developer/restapi_authentifizierung-mit-session-id.html Demonstrates how to start a session by sending credentials and then end the session using cURL. It includes setting headers, handling responses, and managing cookies. Note that a curl_reset might be necessary before subsequent requests. ```bash $data = '{ "username": "jdoe", "password": "2r5iq|!O%{o@?ApR1q%8" }'; $headers = [ 'Accept: application/json', 'Content-Type: application/json', ]; $url = 'http://example.org/jobrouter/api/rest/v2/application/sessions'; // Sitzung beginnen (Benutzer authentifizieren) $curlHandle = curl_init(); curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $headers); curl_setopt($curlHandle, CURLOPT_URL, $url); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_POST, 1); curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $data); curl_setopt($curlHandle, CURLOPT_COOKIEJAR, 'path/to/cooke/file.cookie'); $response = curl_exec($curlHandle); $code = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE); if ($code === 201) { $response = json_decode($response, true); $sessionId = $response['sessions'][0]['sessionId']; } else { echo 'Fehler beim Authentifizieren: ' . $code; var_export($response); } // ... weitere Aktionen hier ... // Bitte beachten Sie, dass eventuell ein curl_reset-Aufruf notwendig ist, // um die cURL-Optionen vor der nächsten Anfrage zurückzusetzen! // Sitzung beenden curl_reset($curlHandle); curl_setopt($curlHandle, CURLOPT_URL, $url); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'DELETE'); curl_setopt($curlHandle, CURLOPT_COOKIEFILE, 'path/to/cooke/file.cookie'); curl_exec($curlHandle); curl_close(); ``` -------------------------------- ### Fetch Inbox Steps using cURL Source: https://docs.jobrouter.com/2026.1/de/developer/restapi_boxen.html This cURL command-line example shows how to retrieve work items from the general inbox. It includes setting the URL, enabling return transfer, specifying the GET request, and using a cookie file for authentication. Error handling for non-200 status codes is also included. ```bash // Benutzer wurde bereits authentifiziert curl_setopt($curlHandle, CURLOPT_URL, 'http://example.org/jobrouter/api/rest/v2/application/workitems/inbox'); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_CUSTOMREQUEST, 'GET'); curl_setopt($curlHandle, CURLOPT_COOKIEFILE, 'path/to/cooke/file.cookie'); $response = curl_exec($curlHandle); $statusCode = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE); curl_close(); if ($statusCode == 200) { $boxData = json_decode($response, true); echo "Anzahl Schritte in der Eingangsbox: "; echo $boxData['meta']['pagination']['total'] . "\n\n"; foreach ($boxData['workitems'] as $item) { echo "Prozessname: " . $item['jrprocessname'] . "\n"; echo "Schrittbezeichnung: " . $item['jrsteplabel'] . "\n"; echo "Workflow-ID: " . $item['jrworkflowid'] . "\n\n"; } } else { echo "Fehler beim Ausführen: Code - " . $statusCode . ", "; echo "Response: " . var_export($response, true); } ``` -------------------------------- ### Initialize Client and Send GET Request Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?restapi_allgemeines-zu-guzzlehttp.html= Initializes the GuzzleHttp client with a base URI and cookie support, then sends a GET request and retrieves the response body. Handles potential exceptions during the request. ```php $client = new Client( [ 'base_uri' => 'http://example.org/jobrouter/api/rest/v2/', 'cookies' => true ] ); try { // Anfrage senden $response = $client->get( 'http://example.org/jobrouter/api/rest/v2/path/to/some/get/route' ); $body = $response->getBody(); // Weitere Informationen aus der Antwort auslesen ... } catch (Exception $e) { echo "Fehler bei der Ausführung: " . $e->getMessage(); } ``` -------------------------------- ### List Inbox Work Items for the Main Instance Source: https://docs.jobrouter.com/2026.1/de/developer/restapi_instanzen.html This example demonstrates how to call the API for the main JobRouter instance when no specific instance number is required. ```APIDOC ## GET /api/rest/v2/application/workitems/inbox ### Description Retrieves a list of work items in the inbox for the authenticated user from the main JobRouter instance. ### Method GET ### Endpoint /api/rest/v2/application/workitems/inbox ### Response #### Success Response (200) - **workItems** (array) - A list of work items available in the inbox. ### Response Example { "workItems": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "Task B", "status": "In Progress" } ] } ``` -------------------------------- ### Preparing Data for Workflow Start Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?restapi_vorgangstarten.html= Prepares an array of data, including file uploads and process fields, to initiate a workflow. Uses CURLFile for file attachments. ```php $mainFile = new CURLFile('/path/to/invoice/file.pdf'); $fileForFirstRow = new CURLFile('/path/to/invoice/myTest1.txt'); $fileForSecondRow = new CURLFile('/path/to/invoice/myTest2.txt'); $inputData = [ 'step' => '1', 'initiator' => 'REST', 'summary' => 'Vorgang gestartet über REST API', // Prozessbetreff 'step_escalation_date' => '2017-10-12T11:00:00+01:00', // Schritteskalation 'processtable[fields][0][name]' => 'INVOICENR', 'processtable[fields][0][value]' => 'IN02984', 'processtable[fields][1][name]' => 'INVOICE_DATE', 'processtable[fields][1][value]' => '2017-08-29T00:00:00+01:00', 'processtable[fields][2][name]' => 'AMOUNT', 'processtable[fields][2][value]' => '12000.78', 'processtable[fields][3][name]' => 'INVOICE_FILE', 'processtable[fields][3][value]' => $mainFile, 'subtables[0][name]' => 'SINVOICE_ATTACHMENTS', // Name der Untertabelle // hier beginnt die erste Zeile der Untertabelle 'subtables[0][rows][0][fields][0][name]' => 'ATT_IN_DATE', 'subtables[0][rows][0][fields][0][value]' => '2017-09-02T14:30:00+01:00', 'subtables[0][rows][0][fields][1][name]' => 'ATT_FILE', 'subtables[0][rows][0][fields][1][value]' => $fileForFirstRow, // hier beginnt die zweite Zeile 'subtables[0][rows][1][fields][0][name]' => 'ATT_IN_DATE', 'subtables[0][rows][1][fields][0][value]' => '2017-09-06T11:28:43+01:00', 'subtables[0][rows][1][fields][1][name]' => 'ATT_FILE', 'subtables[0][rows][1][fields][1][value]' => $fileForSecondRow, ]; ``` -------------------------------- ### Start Incident with cURL (PHP) Source: https://docs.jobrouter.com/2026.1/de/developer/restapi_vorgangstarten.html Starts a new incident using cURL, defining main and sub-table data, including file attachments. Processes the response to extract incident and workflow IDs or error information. ```PHP // Benutzer wurde bereits authentifiziert // Vorgangsdaten definieren $mainFile = new CURLFile('/path/to/invoice/file.pdf'); $fileForFirstRow = new CURLFile('/path/to/invoice/myTest1.txt'); $fileForSecondRow = new CURLFile('/path/to/invoice/myTest2.txt'); $inputData = [ 'step' => '1', 'initiator' => 'REST', 'summary' => 'Vorgang gestartet über REST API', // Prozessbetreff 'step_escalation_date' => '2017-10-12T11:00:00+01:00', // Schritteskalation 'processtable[fields][0][name]' => 'INVOICENR', 'processtable[fields][0][value]' => 'IN02984', 'processtable[fields][1][name]' => 'INVOICE_DATE', 'processtable[fields][1][value]' => '2017-08-29T00:00:00+01:00', 'processtable[fields][2][name]' => 'AMOUNT', 'processtable[fields][2][value]' => '12000.78', 'processtable[fields][3][name]' => 'INVOICE_FILE', 'processtable[fields][3][value]' => $mainFile, 'subtables[0][name]' => 'SINVOICE_ATTACHMENTS', // Name der Untertabelle // hier beginnt die erste Zeile der Untertabelle 'subtables[0][rows][0][fields][0][name]' => 'ATT_IN_DATE', 'subtables[0][rows][0][fields][0][value]' => '2017-09-02T14:30:00+01:00', 'subtables[0][rows][0][fields][1][name]' => 'ATT_FILE', 'subtables[0][rows][0][fields][1][value]' => $fileForFirstRow, // hier beginnt die zweite Zeile 'subtables[0][rows][1][fields][0][name]' => 'ATT_IN_DATE', 'subtables[0][rows][1][fields][0][value]' => '2017-09-06T11:28:43+01:00', 'subtables[0][rows][1][fields][1][name]' => 'ATT_FILE', 'subtables[0][rows][1][fields][1][value]' => $fileForSecondRow, ]; curl_setopt($curlHandle, CURLOPT_URL, 'http://example.org/jobrouter/api/rest/v2/application/incidents/invoice'); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_POST, 1); curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $inputData); curl_setopt($curlHandle, CURLOPT_COOKIEFILE, 'path/to/cookie/file.cookie'); $response = curl_exec($curlHandle); $statusCode = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE); curl_close(); if ($statusCode == 200) { $incidentData = json_decode($response, true); echo "Incident: " . $incidentData['incidents'][0]['incidentnumber'] . "\n"; echo "Workflow-ID: " . $incidentData['incidents'][0]['workflowId'] . "\n"; } else { echo "Fehler beim Ausführen: Code - " . $statusCode . ", "; echo "Response: " . var_export($response, true); } // Benutzer-Session beenden ``` -------------------------------- ### checkProcessStart Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?webservice_checkprocessstart.html= Queries the status of an asynchronously started process using its Task ID. If no Task ID is provided, one will be generated automatically. ```APIDOC ## checkProcessStart ### Description Queries the status of an asynchronously started process using its Task ID. If no Task ID is provided, one will be generated automatically. ### Method POST (Assumed, as it's a method call that likely modifies or retrieves state based on input) ### Endpoint /checkProcessStart ### Parameters #### Query Parameters - **taskId** (string) - Optional - Unique identifier for the asynchronous process start. If not provided, a Task ID will be automatically generated. ### Response #### Success Response (200) - **ProcessStartInfo** (ServiceObject_ProcessStartInfo) - An object containing the current process start information. ``` -------------------------------- ### checkProcessStart Source: https://docs.jobrouter.com/2026.1/de/developer/webservice_checkprocessstart.html Checks the current status of a newly started asynchronous process using the Task ID provided during initiation. It returns a ProcessStartInfo object containing the status. ```APIDOC ## checkProcessStart ### Description Retrieves the status of an asynchronously started process using its unique Task ID. ### Method POST (Assumed, as status retrieval often involves sending an identifier) ### Endpoint /webservice/checkProcessStart ### Parameters #### Query Parameters - **taskId** (string) - Optional - Unique identifier for the asynchronous process start. If not provided, a Task ID will be automatically generated. ### Response #### Success Response (200) - **ServiceObject_ProcessStartInfo** (object) - An object containing the process start information and its current status. ``` -------------------------------- ### Get Current Username Example Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?dashboard_getcurrentusername.html= This snippet demonstrates how to retrieve the currently logged-in user's username using the deprecated getCurrentUsername function. It is useful for conditional logic, such as authorizing widgets. ```php $currentUsername = $this->getCurrentUsername(); ``` -------------------------------- ### GET /application/users/:username/archives/:archive Source: https://docs.jobrouter.com/2026.1/de/developer/_hm_print_window.htm?restapi_archiveigenschaften-ermitteln.html= Retrieves detailed properties of a specified archive, including its index field definitions. The archive can be identified by its database table name or GUID. The request must be made within a user's context, and only users with access to the archive can retrieve this information. ```APIDOC ## GET /application/users/:username/archives/:archive ### Description Retrieves detailed properties of a specified archive, including its index field definitions. The archive can be identified by its database table name or GUID. The request must be made within a user's context, and only users with access to the archive can retrieve this information. ### Method GET ### Endpoint /application/users/:username/archives/:archive ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user making the request. - **archive** (string) - Required - The database table name or GUID of the archive to query. ### Response #### Success Response (200) - **users** (object) - Contains archive information. - **archives** (array) - A list of archives. - **name** (string) - The name of the archive. - **indexFieldDefinitions** (array) - A list of index field definitions for the archive. - **name** (string) - The name of the index field. - **required** (boolean) - Indicates if the index field is required. ### Response Example ```json { "users": { "archives": [ { "name": "Invoices", "indexFieldDefinitions": [ { "name": "deadline", "required": true } ] } ] } } ``` ``` -------------------------------- ### Create Dataset using cURL Source: https://docs.jobrouter.com/2026.1/de/developer/restapi_anlegen_und_bearbeiten_von_dat.html This example demonstrates creating a dataset via cURL. It includes setting headers, the request method, and the JSON payload. Ensure the cookie file path is correct. ```php [ 'sname' => 'Acme Corp.', 'sadress' => 'Acme Rd. 12', 'sdate' => '2017-09-03T13:22:45+01:00', 'sphone' => '076-343-5226', 'srating' => 6 ], ]; $headers = [ 'Accept: application/json', 'Content-Type: application/json', ]; curl_setopt($curlHandle, CURLOPT_HTTPHEADER, $headers); curl_setopt( $curlHandle, 'http://example.org/jobrouter/api/rest/v2/application/jobdata/' . 'tables/2076E38C-3EC0-234E-EFFD-E15F14879CB1/datasets' ); curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curlHandle, CURLOPT_POST, 1); curl_setopt($curlHandle, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($curlHandle, CURLOPT_COOKIEFILE, 'path/to/cooke/file.cookie'); // Datensatz anlegen $response = curl_exec($curlHandle); $statusCode = curl_getinfo($curlHandle, CURLINFO_HTTP_CODE); curl_close(); if ($statusCode == 200) { // Antwort anzeigen $data = json_decode($response, true); echo "Datensatz-ID: " . $data['datasets'][0]['jrid'] . "\n"; } else { echo "Fehler beim Ausführen: Code - " . $statusCode . ", "; echo "Response: " . var_export($response, true); } // Benutzer-Session beenden ?> ``` -------------------------------- ### Handlebars Unless Block Example Source: https://docs.jobrouter.com/2026.1/de/developer/dashboard_unless_block.html Use the unless block to render content when a condition is false. This example shows rendering 'Unknown Author' when the 'author' object is not present or empty. ```handlebars