Content Information
What does the Content Information Endpoint do?
The Content Information endpoint supports the inclusion of both Instant and Flex purchase models in the library catalog, returning additional data points related to the availability of the individual title license. If the content endpoint response returns a purchase Model value of Flex then it is necessary to call the data information endpoint to determine the status of the title. This endpoint allows you to verify the purchase model for a given title or list of titles as well as the availability status.
Using the Content Information Endpoint
Checking the purchase model of a certain title at a given library is a use case for calling the Content Information endpoint. The response values for status are BORROW, HOLD and UNAVAILABLE. If the status is BORROW then a patron should be presented a Borrow button which would call the Hoopla patron checkout endpoint. If the status is HOLD then a patron should be presented a Hold button which would call the Hoopla patron hold endpoint. If the status is UNAVAILABLE no button should be presented and it is likely the title should no longer be presented to patrons. You also may want to check whether a flex title is available to borrow or if there is a wait list. If the latter is true, you would also be able to see the hold queue size and number of copies.
When refreshing Flex title availability, you will want to use two endpoints together, Content Info and either Content Extraction or Library Entitlements.
Below is an example of steps to take with the API calls:
1. Every 10 minutes, call the Library Entitlements endpoint with a startTime set to your last successful run. Of the two endpoints used for an availability refresh, Library Entitlements is the one that supports startTime, Content Info does not, and it's built to be polled often.
2. That call gives you back the contentIds that have changed. Take just those IDs and pass them to Content Info (up to 50 at a time) to get the full availability details for those titles.
So Library Entitlements tells you what has changed, and Content Info tells you the full picture for those specific titles. Neither endpoint does the whole job alone, Content Info has no way to ask "what's changed," and Library Entitlements doesn't carry full availability info by itself.
This also keeps each 10-minute run lightweight, since you're only pulling full details for the titles that actually changed, not the whole library.
Content Information Endpoint Documentation
GET: /api/v1/libraries/{libraryId}/content/info
Response Class (Status 200)
Model Schema
[
{
"contentId": 9007199254740991,
"availability": {
"status": "BORROW",
"available": true,
"holdsQueueSize": 1073741824,
"availableCopies": 1073741824,
"totalCopies": 1073741824,
"holdsQueuePosition": 1073741824,
"purchaseModel": "INSTANT"
}
}
]Response Messages
| HTTP Status Code | Reason |
|---|---|
| 401 | expected response when requesting an access token with an invalid Authorization header |
Example Requests and Responses
Example Request
https://hoopla-api.hoopladigital.com/api/v1/libraries/7/content/info?contentIds=13983016
curl -X 'GET' \
'https://hoopla-api.hoopladigital.com/api/v1/libraries/7/content/info?contentIds=13983016' \
-H 'accept: */*' \
-H 'Authorization: Bearer 972323ad-8e22-47b5-9619-2d61573678f5'Example Response
[
{
"contentId": 13983016,
"availability": {
"status": "HOLD",
"holdsQueueSize": 0,
"availableCopies": 0,
"totalCopies": 6,
"purchaseModel": "FLEX"
}
}
]← Return home