.. include:: /atkeywords.rst .. _Contract_RestApiModule_SmartCardReader: ######################################### RestApiModule - SmartCardReader Api ######################################### .. _Contract_RestApiModule_SmartCardReader_GetSmartCardReaderState: Get smartcard reader state ************************** Returns the :ref:`SmartCardReaderState `. **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}/smartcardreader/state **Example request**: .. sourcecode:: http GET /endcustomers/edfd1133-88ec-4f2d-abb8-16238c6ad926/assets/10401990013-123455789/restapi/hal/devices/smartcardreader1/smartcardreader/state 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 { "smartCardReaderStates": [2,32,256], "smartCardType":1 } :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 array smartCardReaderStates: an array of SCardState values. see :ref:`SCardState ` for more info. :>json integer smartCardType: the type of the inserted smartcard (if any). see :ref:`SCardType ` for more info. .. _Contract_RestApiModule_SmartCardReader_GetSmartCardFiles: Get smartcard files ******************* Returns the content of a file available on the smartcard. **Authorization level** * :red:`30 (RestApiModuleGetData )` **URL parameters** * **endcustomerId**: Endcustomer Id. * **assetId**: Asset Id. * **deviceId**: Device Id of peripheral linked to the asset. * **fileId**: integer. Id of the file to be read. The id depends on the :ref:`smart card type ` . See :ref:`file ids ` for more info. .. http:get:: /endcustomers/{endcustomerId}/assets/{assetId}/restapi/hal/devices/{deviceId}/smartcardreader/files/{fileId} **Example request**: .. sourcecode:: http GET /endcustomers/edfd1133-88ec-4f2d-abb8-16238c6ad926/assets/10401990013-123455789/restapi/hal/devices/smartcardreader1/smartcardreader/files.1 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 { "version": "string", "cardNumber": "string", //other ID data... } :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 object fileData: The response body contains the content of the requested file if the file id exists and if a smartcard is inserted. See :ref:`file ids ` for more info. .. _Contract_RestApiModule_SmartCardReader_ReaderStates: SCardState ********** Indicates the state of the reader - Unaware = 0 - Ignore = 1 : reader should be ignored - Changed = 2 : state has changed - Unknown = 4 : unknown reader - Unavailable = 8 : state not available for this reader - Empty = 16 : no card in reader - Present = 32 : card in reader - AtrMatch = 64 : atr match - Exclusive = 128 : the card in the reader is allocated by an application exclusively - InUse = 256 : the card is in use by one or more applications - Mute = 512 : there is an unresponsive card in the reader - Unpowered = 1024 : the card is unpowered .. _Contract_RestApiModule_SmartCardReader_SmartCardTypes: SCardType ********** Indicates the card type of the inserted smartcard. - Unknown = 0 - BEID = 1 - SLE4442 = 2 .. _Contract_RestApiModule_SmartCardReader_SmartCardFileIds: Card file ids ************** enumeration FileIds: - ID = 1 (BEID) - Address = 2 (BEID) - Photo = 3 (BEID) - SLE4442Data (SLE4442) File content schema's ********************* BEID.ID ======= :: { "version": "string", "cardNumber": "string, "chipNumber": "string", "validityDateBegin":"string", "validityDateEnd":"string", "nationalNumber":"string", "name":"string", "firstName1":"string", "firstName2":"string", "nationality":"string", "birthLocation":"string", "birthDate":"string", "sex":"string", "nobleCondition":"string", "documentType":int, "whiteCane":bool, "yellowCane":bool, "extendedMinority":bool, "hashPhoto":"string", "rfu":"string" } BEID.Address ============ :: { "version":"string", "street":"string", "streetNumber":"string", "boxNumber":"string", "zip":"string"; "municipality":"string", "country":"string", "rfu":"string" } BEID.Photo ========== Base64 string of binary image. SLE4442.Data ============ 256bytes in Hex Format :: "A2131091FFFF8115FFFFFFFFFFFFFFFF00040000FDD27600000400FFFFFFF...FF" .. _Contract_RestApiModule_SmartCardReader_Events: Events ****** A webhook message is sent when a smart card is inserted or retracted. **Authorization level** * :red:`32 (RestApiModuleNotification )` **Properties** * **event.methodName** (string): "receiveSmartCardReaderState" * **event.arguments** (array): array of inserted or retracted smartcards. See also :ref:`get smartcardreader state `. * **event.deviceId** (string): id of smartcardreader 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": "receiveSmartCardReaderState", "arguments": [{ "smartCardReaderStates": [2,32,256], //see SCardState enumeration value "smartCardType": 1, //see SCardType enumeration value "deviceId": "smartcardreader1", "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" }