BarcodeScanner
Get last scanned barcode
This call will return the last scanned barcode, with the scanned timestamp.
URL parameters
hostIp: ip address of the API host.
deviceId: id of the device.
- GET https://{hostIp}:7081/hal/devices/{deviceId}/barcodescanner/lastscanned
Example request:
GET /hal/devices/barcode1/barcodescanner/lastscanned HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS...
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "barcodeString": "9783642088421", "timestamp": "2026-06-03T10:25:15.7337898Z" }
- Status Codes:
200 OK – OK
204 No Content – No barcode scanned yet
400 Bad Request – Bad Request. A descriptive error comes along with this error.
401 Unauthorized – Unauthorized. Something is wrong with the Authorization header of the request
403 Forbidden – Forbidden. Something is wrong with the claims of the user.
500 Internal Server Error – Internal Server Error
- Response Headers:
Content-Type – defines the serialization format for the response body (this depends on the Accept header of the request)
- Response JSON Object:
barcodeString (string) – last read barcode
timestamp (string) – timestamp (utc) of last read barcode
Events
BarcodeScanner Events
The websocket server will send an event to a registered websocket client when a barcode is presented.
The event has the following format:
"messageType":1,
"data":
{
"methodName":"receiveBarcode",
"arguments": [{
"barcodes": [{
"barcodeString":"string",
"timstamp":"datetime (utc)"
}],
"deviceId": "barcodescanner1",
"version": "1.0"
}]
}