ID Inline
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
Device Workflow
The typical workflow for using an ID Inline device follows these steps:
- Initialize lifecycle services
- Start a scan with
deviceClass: id-inline(orid-inline-mockfor testing — see Mock Devices) - Monitor available devices
- Connect to the device using the discovered identifier
- Stop the scan
- Calibrate / tare (measurementKey:
tare) - Measure (measurementKey:
measure) - Disconnect
- Shut down lifecycle services
Complete Workflow Example
Step 1: Lifecycle Initialize
Before any device operations, initialize the Elements Hub services:
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:
POST /v1/device-scans
Content-Type: application/json
{
"deviceClass": "id-inline"
}
Response:
{
"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:
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:
[
{
"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:
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:
{
"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:
DELETE /v1/device-scans/<scanId>
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.
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:
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:
DELETE /v1/devices/abc123def
Step 9: Lifecycle Shutdown
When shutting down your application, properly shutdown the internal Elements Hub services:
POST /v1/lifecycle/shutdown
Image Acquisition
Retrieve images from the ID Inline device:
GET /v1/devices/abc123def/images/camera
Accept: image/png