RR GET API for fetching access log entries

https://folio-org.atlassian.net/browse/UXPROD-4070

Overview:

A new API is created to fetch the access log entries which are created through Reading Room APP.

Access log table is storing the following properties

  1. id

  2. userId

  3. patronId

  4. action (ALLOWED, DENIED)

  5. readingRoomId

  6. readingRoomName

  7. servicePointId

you can find the description of each property in the response section in this docs. This API supports CQL query. So one can retrieve data based on any of the above properties.

Endpoint:

GET - https://folio-snapshot-okapi.dev.folio.org/reading-room/access-log - Please replace the host based on the environment.

Request Format : Following are the 3 query params supported by this API.

  1. query - cql string. API will retrieve the data which are matching to this CQL query. Default query is cql.allRecords=1 which will retrieve all the records.

  2. offset - The offset for pagination, indicating the starting index of the result set. Default offset is 0.

  3. limit- The maximum number of access log entries to retrieve. Default limit is 1000.

Sample request’s :

For retrieving access log based on readingRoomName and servicePointId

https://folio-snapshot-okapi.dev.folio.org/reading-room/reading-room/access-log?query=servicePointId=="c4c90014-c8c9-4ade-8f24-b5e313319f4b" and readingRoomName=="monday reading room"

Above request will retrieve all the access log entries which are matching with the given servicePointId and given readingRoomName

For retrieving access log based on userId or action

https://folio-snapshot-okapi.dev.folio.org/reading-room/access-log?query=userId=="21457ab5-4635-4e56-906a-908f05e9233b" or action=="DENIED"

Above request will retrieve all the access log entries which are matching either the given userId or given action

Sample response:

{     "accessLogs": [         {             "id": "4a68891e-07bb-43cb-b6d4-00dcee000271",             "readingRoomId": "2a5a1043-6179-4c9a-a1dd-fae7e6cfe39a",             "readingRoomName": "monday reading room",             "servicePointId": "c4c90014-c8c9-4ade-8f24-b5e313319f4b",             "userId": "21457ab5-4635-4e56-906a-908f05e9233b",             "patronId": "2205005b-ca51-4a04-87fd-938eefa8f6de",             "action": "DENIED"         },         {             "id": "423c4f3a-8a0c-4f21-93f1-e17b2a3a3260",             "readingRoomId": "2a5a1043-6179-4c9a-a1dd-fae7e6cfe39a",             "readingRoomName": "monday reading room",             "servicePointId": "c4c90014-c8c9-4ade-8f24-b5e313319f4b",             "userId": "21457ab5-4635-4e56-906a-908f05e9233b",             "patronId": "2205005b-ca51-4a04-87fd-938eefa8f6de",             "action": "DENIED"         }     ],     "totalRecords": 2 }