.. include:: /atkeywords.rst .. _Contract_RestApiModule_BarcodeScanner: ######################################### RestApiModule - BarcodeScanner Api ######################################### .. _Contract_RestApiModule_BarcodeScanner_GetLastScannedBarcode: Get last scanned barcode ************************* Returns the last scanned barcode, with the scanned timestamp. **Authorization level** * :red:`30 (RestApiModuleGetData )` **URL parameters** * **endcustomerId**: Endcustomer Id. * **assetId**: Asset Id. * **deviceId**: Device Id of peripheral linked to the asset. .. http:get:: /endcustomers/{endcustomerId}/assets/{assetId}/restapi/hal/devices/{deviceId}/barcodescanner/lastscanned **Example request**: .. sourcecode:: http GET /endcustomers/edfd1133-88ec-4f2d-abb8-16238c6ad926/assets/10401990013-123455789/restapi/hal/devices/barcodescanner1/barcodeScanner/lastscanned HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... X-API-Version: 1.0 **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Api-Supported-Versions: 1.0 { "barcodeString": "9783642088421", "timestamp": "2026-06-03T10:25:15.7337898Z" } :statuscode 200: OK :statuscode 400: Bad Request, parameters validation failed :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. :statuscode 429: Too Many Requests. :statuscode 500: Internal Server Error :resheader Content-Type: application/json; charset=utf-8 :resheader Api-Supported-Versions: supported api versions :>json string barcodeString: last read barcode :>json string timestamp: timestamp (utc) of last read barcode .. _Contract_RestApiModule_BarcodeScanner_Events: Events ****** A webhook message is sent when a barcode is scanned. **Authorization level** * :red:`32 (RestApiModuleNotification )` **Properties** * **event.methodName** (string): "receiveBarcode" * **event.arguments** (array): array of scanned barcodes. See also :ref:`get last scanned barcode `. * **event.deviceId** (string): id of barcode scanner attached to the gateway. * **event.version** (string): '1.0' * **event.$type** (int): '300' = events coming from the RestApiModule. See :ref:`webhook message event types `. * **moduleId**: See :ref:`webhook common webhook message properties `. * **$type**: See :ref:`webhook common webhook message properties `. * **version**: See :ref:`webhook common webhook message properties `. * **createdUtc**: See :ref:`webhook common webhook message properties `. * **reportedUtc**: See :ref:`webhook common webhook message properties `. * **id**: See :ref:`webhook common webhook message properties `. * **assetId**: See :ref:`webhook common webhook message properties `. :: { "event": { "methodName": "receiveBarcode", "arguments": [{ "barcodes": [{ "barcodeString":"string", "timestamp":"datetime (UTC)" }], "deviceId": "barcodescanner1", "version": "1.0" }], "$type": 300 }, "moduleId": "RestApiModule1", "$type": 2, "version": 1, "createdUtc": "2026-11-20T10:56:56.0170712Z", "reportedUtc": "2026-11-20T10:56:47.056Z", "id": "7b1ad0e7-2759-48a4-8465-1a795f72c61c", "assetId": "10401990013-123004002" }