.. _SystemIntegration_HandlingBarcodeScanner: ############### 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. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/barcodescanner/lastscanned **Example request**: .. sourcecode:: http GET /hal/devices/barcode1/barcodescanner/lastscanned HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "barcodeString": "9783642088421", "timestamp": "2026-06-03T10:25:15.7337898Z" } :statuscode 200: OK :statuscode 204: No barcode scanned yet :statuscode 400: Bad Request. A descriptive error comes along with this error. :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. Something is wrong with the claims of the user. :statuscode 500: Internal Server Error :resheader Content-Type: defines the serialization format for the response body (this depends on the :mailheader:`Accept` header of the request) :>json string barcodeString: last read barcode :>json string timestamp: 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" }] }