.. _SystemIntegration_HandlingSmartCardReader: ############### SmartCardReader ############### .. _SystemIntegration_SmartCardReader_GetSmartCardReaderState: Get smartcard reader state ************************** This returns the :ref:`SmartCardReaderState `. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: Id of the smartcardreader. .. http:get:: https://{hostIp}:7081/hal/devices/{deviceId}/smartcardreader **Example request**: .. sourcecode:: http GET /hal/devices/smartcardreader1/smartcardreader 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 { "smartCardReaderStates": [2,32,256], "smartCardType":1 } :statuscode 200: OK :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 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 enumeration ` for more info. .. _SystemIntegration_SmartCardReader_GetSmartCardFiles: Get smartcard files ******************* This returns the content of a file available on the smartcard. **URL parameters** * **hostIp**: Ip address of the API host. * **deviceId**: Id of the smartcardreader. * **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:: https://{hostIp}:7081/hal/devices/{deviceId}/smartcardreader/files/{fileId} **Example request**: .. sourcecode:: http GET /hal/devices/smartcardreader1/smartcardreader/files/1 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 { "version": "string", "cardNumber": "string", ... } :statuscode 200: OK :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 404: Not Found. The requested file could not be found. :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 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. Enumeration values ****************** .. _SystemIntegration_SmartCardReader_ReaderStates: Enumeration 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 .. _SystemIntegration_SmartCardReader_SmartCardTypes: Enumeration SCardType ====================== Indicates the card type of the inserted smartcard. - Unknown = 0 - BEID = 1 - SLE4442 = 2 .. _SystemIntegration_SmartCardReader_SmartCardFileIds: Enumeration 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" Events ****** SmartCardReader Events ======================= The websocket server will send updates to a registered websocket client when a card is inserted or retracted. The event has the following format: :: "messageType":1, "data": { "methodName":"receiveSmartCardReaderState", "arguments": [{ "smartCardReaderStates": [2,32,256], //see SCardState enumeration value "smartCardType": 1, //see SCardType enumeration value "deviceId": "smartcardreader1", "version": "1.0" }] }