# ID Inline > [!note] Cette page n'est pas encore traduite et s'affiche en anglais. This guide provides detailed information about working with ID Inline instruments using the Elements Hub API. If you do not want to use the REST API directly, consider generating the SDK library. See [Client Code Generation](rhopoint-elements-hub-client-code-generation.md) ### Device Workflow The typical workflow for using an ID Inline device follows these steps: 1. [Initialize lifecycle services](rhopoint-elements-hub-endpoints-functionality-lifecycle.md) 2. [Start a scan](rhopoint-elements-hub-endpoints-functionality-device-scans.md) with `deviceClass: id-inline` (or `id-inline-mock` for testing — see [Mock Devices](rhopoint-elements-hub-mock-devices.md)) 3. [Monitor available devices](rhopoint-elements-hub-endpoints-functionality-device-scans.md#polling-discovered-devices) 4. [Connect to the device](rhopoint-elements-hub-endpoints-functionality-connected-devices.md) using the discovered identifier 5. [Stop the scan](rhopoint-elements-hub-endpoints-functionality-device-scans.md#stopping-a-scan) 6. Calibrate / tare (measurementKey: `tare`) 7. [Measure](rhopoint-elements-hub-endpoints-functionality-measurement-triggers.md) (measurementKey: `measure`) 8. [Disconnect](rhopoint-elements-hub-endpoints-functionality-connected-devices.md#disconnecting-a-device) 9. [Shut down lifecycle services](rhopoint-elements-hub-endpoints-functionality-lifecycle.md) ### Complete Workflow Example #### Step 1: Lifecycle Initialize Before any device operations, initialize the Elements Hub services: ```http POST /v1/lifecycle/initialize Content-Type: application/json { "dataDirectory": "C:\\ProgramData\\ElementsHub\\Data", "logDirectory": "C:\\ProgramData\\ElementsHub\\Logs" } ``` #### Step 2: Scan for ID Inline Devices Start scanning for available ID Inline devices: ```http POST /v1/device-scans Content-Type: application/json { "deviceClass": "id-inline" } ``` **Response:** ```json { "identifier": "abc123def", "scanFilter": { "deviceClass": "id-inline", "serialNumberFilter": null, "ipAddressFilter": null }, "status": "scanning", "foundDevices": [] } ``` #### Step 3: Get Available Devices Retrieve the list of currently discovered devices: ```http GET /v1/available-devices Accept: application/json ``` The endpoint returns every device discovered by any active scan; there is no filter parameter. Filter client-side on `deviceClass` if you need to. **Response:** ```json [ { "discovered": "2042-11-07T12:22:14.9762102+00:00", "identifier": "abc123def", "deviceClass": "id-inline", "serialNumber": "12345", "serialNumbers": [ "12345" ], "hardwareVersion": "…", "firmwareVersion": "…", "softwareVersion": "…", "componentVersions": [] } ] ``` #### Step 4: Connect to Device Connect to a specific ID Inline device using its identifier: ```http POST /v1/devices Content-Type: application/json { "deviceIdentifier": "abc123def", "parameters": [ { "key": "flipX", "value": false }, { "key": "flipY", "value": false } ] } ``` **Connection Parameters:** | Parameter | Type | Description | Default | | --- | --- | --- | --- | | `flipX` | Boolean | Flip image horizontally | `false` | | `flipY` | Boolean | Flip image vertically | `false` | **Response:** ```json { "connectTime": "2042-11-07T12:25:45Z", "identifier": "abc123def", "deviceClass": "id-inline", "serialNumber": "12345", "serialNumbers": ["12345"], "hardwareVersion": "…", "firmwareVersion": "…", "softwareVersion": "…", "componentVersions": [] } ``` #### Step 5: Stop Scan Once connected, stop the device scan to free up resources. Use the **scan** identifier (returned by `POST /v1/device-scans` in Step 2), not the device identifier: ```http DELETE /v1/device-scans/ ``` The `foundDevices` array in the scan response contains the **identifiers** of every device discovered during the scan, not their serial numbers. #### Step 6: Calibrate Device (Tare) Before taking measurements, calibrate the device using the "tare" measurement trigger. This establishes a baseline reference for subsequent measurements: The tare functionality will be moved to the calibrations endpoint in a future release. ```http POST /v1/devices/idInline-ABC12345/measurement-triggers Content-Type: application/json { "measurementKey": "tare", "containerFormat": "raeJson" } ``` #### Step 7: Take Measurements Execute measurement operations using the "measure" trigger: ```http POST /v1/devices/abc123def/measurement-triggers Content-Type: application/json { "measurementKey": "measure", "containerFormat": "raeBinary", "parameters": [ { "key": "align", "value": true }, { "key": "expose", "value": true }, { "key": "includeAttachments", "value": true } ] } ``` The two container formats `raeBinary` and `raeJson` are available. **Measurement Parameters:** | Parameter | Type | Description | Default | | --- | --- | --- | --- | | `align` | Boolean | Perform automatic alignment before measurement | `true` | | `expose` | Boolean | Perform automatic exposure adjustment before measurement | `true` | | `includeAttachments` | Boolean | Include image data in the measurement result | `true` | #### Step 8: Disconnect from Device When finished with measurements, disconnect from the device: ```http DELETE /v1/devices/abc123def ``` #### Step 9: Lifecycle Shutdown When shutting down your application, properly shutdown the internal Elements Hub services: ```http POST /v1/lifecycle/shutdown ``` ### Image Acquisition Retrieve images from the ID Inline device: ```http GET /v1/devices/abc123def/images/camera Accept: image/png ```