Api  >  Library Book Holdings Service


Library Book Holdings Service

Service URL /v1/libraries/{libraryId}/book-holdings

Service Endpoints


Description

Each day, a snapshot of each library's book holdings (both ebook and audiobook) is taken, and written to a database.  Those snapshots are retained for ~60 days.  After that, only the 1st of the month snapshots are retained.

The Library Book Holdings Service has three endpoints.

  • The 'Available Dates' endpoint returns a record for each day a snapshot is available for a given library, and total holding counts for ebook and audiobook.
  • The 'Snapshot on Date' endpoint, returns the snapshot that was taken for the given library.  The snapshot includes total holding counts for ebook and audiobook, as well as a list of holdings.
  • The 'From, To', retrieves the snapshot for the two dates, and then returns the delta.  The delta consists of a summary count of books removed, and books added, as well as a list of the books removed and books added.

The Holdings Delta service endpoints do NOT return book metadata.  This endpoint is intended to provide book holding snapshots and deltas.  Book metadata is served up by the Book Info Service.

 

Holdings Delta: Available Dates

Endpoint URL /v1/libraries/{libraryId}/book-holdings/delta/available-dates
Description
Gets dates for which holdings snapshots are available
Http Messages
HTTP GET Request
Fiddler Request
GET /v1/libraries/474/book-holdings/delta/available-dates HTTP/1.1
UserAgent: robobob
Host: api.rbdigital.staging
Authorization: basic {basicToken}
Content-Type: application/json

HTTP GET Response
Response
[
  {
    "tenantId": 2138,
    "asOf": "2017-09-26",
    "eBookCount": 2,
    "eAudioCount": 77,
    "totalCount": 79
  },
  {
    "tenantId": 2138,
    "asOf": "2017-09-25",
    "eBookCount": 2,
    "eAudioCount": 77,
    "totalCount": 79
  },
  {
    "tenantId": 2138,
    "asOf": "2017-09-24",
    "eBookCount": 2,
    "eAudioCount": 77,
    "totalCount": 79
  },
  {
    "tenantId": 2138,
    "asOf": "2017-09-23",
    "eBookCount": 2,
    "eAudioCount": 77,
    "totalCount": 79
  },
  {
    "tenantId": 2138,
    "asOf": "2017-09-22",
    "eBookCount": 2,
    "eAudioCount": 77,
    "totalCount": 79
  }
]

 



Holdings Delta: From, To

Endpoint URL /v1/libraries/{libraryId}/book-holdings/delta?begin={begin}&end={end}
Description
Gets the delta between two dates
Http Messages
HTTP GET Request
Fiddler Request
GET /v1/libraries/{libraryId}/book-holdings/delta?end=2017-11-25&&begin=2017-11-24 HTTP/1.1
User-Agent: fiddler
Authorization: basic {basicToken}
Host: api.rbdigitalstage.com
Accept: application/json

HTTP GET Request
Response
{
  "tenantId": 9999,
  "beginDate": "2017-11-25",
  "endDate": "2017-11-24",
  "addedBooks": [
    {
      "id": 1029814,
      "isbn": "9781456107611",
      "mediaType": "eAudio"
    },
    {
      "id": 1031179,
      "isbn": "9781456113865",
      "mediaType": "eAudio"
    },
    {
      "id": 1026341,
      "isbn": "9781470300777",
      "mediaType": "eAudio"
    },
    {
      "id": 1030211,
      "isbn": "9781456113858",
      "mediaType": "eAudio"
    },
    {
      "id": 1031462,
      "isbn": "9781456130152",
      "mediaType": "eAudio"
    }
  ],
  "removedBooks": [
    {
      "id": 1067375,
      "isbn": "9781501940477",
      "mediaType": "eAudio"
    },
    {
      "id": 1067392,
      "isbn": "9781501953545",
      "mediaType": "eAudio"
    },
    {
      "id": 6153947,
      "isbn": "9781427206374",
      "mediaType": "eAudio"
    }
  ],
  "booksAddedCount": 5,
  "booksRemovedCount": 3
}


Holdings Delta: Snapshot on Date

Endpoint URL /v1/libraries/{libraryId}/book-holdings/{date}
Description
Gets the holdings for a given date
Http Messages
HTTP GET Request
Fiddler Request
GET /v1/libraries/{libraryId}/book-holdings/2017-09-24 HTTP/1.1
User-Agent: robo-bob
Authorization: basic {basicToken}
Host: api.rbdigital.stage
Accept: application/json

HTTP GET Response
Response
{
  "tenantId": 824,
  "asOf": "2017-09-24",
  "eBookCount": 3,
  "eAudioCount": 3,
  "totalCount": 6,
  "books": [
    {
      "id": 5355168,
      "isbn": "9781101622742",
      "mediaType": "eBook"
    },
    {
      "id": 5411855,
      "isbn": "9780062368683",
      "mediaType": "eBook"
    },
    {
      "id": 5428654,
      "isbn": "9780739330296",
      "mediaType": "eAudio"
    },
    {
      "id": 5431445,
      "isbn": "9780062368690",
      "mediaType": "eAudio"
    },
    {
      "id": 5474605,
      "isbn": "9781101158104",
      "mediaType": "eBook"
    },
    {
      "id": 5658889,
      "isbn": "9781470352516",
      "mediaType": "eAudio"
    }
  ]
}