Data Information
What does the Data Information Endpoint do?
The Data 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 Data Information Endpoint
Checking the purchase model of a certain title at a given library is a use case for calling the Data 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 checkout endpoint. If the status is HOLD then a patron should be presented a Hold button which would call the Hoopla 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.
Data Information Endpoint Documentation
GET: /api/v1/libraries/{libraryId}/content/info
Response Class (Status 200)
Model Schema
[
{
"contentId": 0,
"availability": {
"status": "BORROW",
"available": true,
"holdsQueueSize": 0,
"availableCopies": 0,
"totalCopies": 0,
"holdsQueuePosition": 0,
"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
http://hoopla-api.hoopladigital.com/api/v1/libraries/7/content/info?contentIds=13983016
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer e42fe129-cdd9-4e6a-a33b-91f56ab6d8c5' --header 'ws-api: 2.1' 'http://hoopla-api.hoopladigital.com/api/v1/libraries/7/content/info?contentIds=13983016'
Example Response
[
{
"contentId": 13983016,
"availability": {
"status": "HOLD",
"holdsQueueSize": 0,
"availableCopies": 0,
"totalCopies": 6,
"purchaseModel": "FLEX"
}
}
]
← Return home