...
eBook-samples
Downloading e-book samples can be downloaded directly using the resource-id found in the Inventory service. Note that due to historical reasons, samles for audio are not available from DDS, only from the ObjectsAPI.
Info |
---|
New Authentication & URLs introduced Q2 2024 |
Get ebook samples content
Initiates a download process for ebook samples.
URL |
|
GET
Request
headers
Authorization
Required
|
|
Date
Required
| |||
Method |
| ||
Request | Authorization | Required | The token acquired from the Authentication Service. Audience: Example: |
Accept | Required | application/json (We recommend all new implementations to use this header, XML support will be phased out in the future) | |
Response | Location |
| |
Response | None | ||
Returns |
| Found (on success, you will receive this code and a redirection to the resource download status page) |
Get content (based on fulfillment ID)
Initiates a download process, and starts preparing the individual watermarked file for download (if SDRM).
URL |
|
Method
GET
Request
headers
Authorization
|
|
Date
Required
| |||
Method |
| ||
Request | Authorization | Required | The token acquired from the Authentication Service. Audience: Example: |
Accept | Required | application/json (We recommend all new implementations to use this header, XML support will be phased out in the future) | |
Parameters | type | Optional* | Which type of the resource are you requesting. This is only required for audio books, if missing you will get a http 300 response providing you with the various options. |
bitrate | Optional* | Which bitrate for the file are you requesting. This is only required for audio books, if missing you will get a http 300 response providing you with the various options. Currently, the only available option here is 64. | |
Response | Location |
| |
Response | None | ||
Returns |
| Found (on success, you will receive this code and a redirection to the resource download status page) | |
| Multiple Choices |
Details on type and bitrate parameters
These parameters are only needed for audio files and they are required in order to specify which file format you want for audio. The complete list of possible value combination are in the table below. Note that you as integrator is responsible for selecting the right type, depending on which access you are giving your customers to the file. Selection of the right type is imperative for ensuring rights are handled correctly and for best performance of your application.
Current value | Is file for download (Can customer access the actual file, or is it closed in an app) |
---|---|
| Yes |
| Only for use for download in closed ecosystem where user cannot access file (e.g in app). If you are using complete file for streaming (progressive download) see audio/mpeg3 at the bottom. Do not use this for streaming. |
| Yes |
| Only for use in closed ecosystem where user cannot access file (e.g in app). |
| HLS is only for use in closed ecosystems (e.g in app). |
| Complete progressive download is only for use in closed ecosystems (e.g in app). If you are simulating streaming in your app using progressive downloads, this option gives you better performance than the complete download as caching is adjusted to fit a streaming scenario. |
Note that some publishers might not allow all formats (currently this is only relevant for international publishers), meaning that not all formats are available for all books. This will be reflected in the HTTP 300 response. Usually these restrictions is that public download of files is not allowed, and then no -public versions are available and you cannot give access to consumers to download the file outside a secure app environment.
...
This service can only be accessed after calling Get content, and been given a link to a status service page
URL |
| ||
Method |
| ||
Request | This service uses a random generated URL with limited life time, no authentication is required, but use Accept header to get response in json or XML. | ||
Response |
- or -
- or -
| ||
Returns |
| OK |
Handling various status messages
Depending on the resource requested, some processing might be required on the server to prepare the individual file for the order. The status parameter in the json document shows you the status on the files preparation. Below you see a table of possible values and how you should handle each of them.
Value | Meaning | Action |
---|---|---|
| File is ready to be accessed | Access URL given in downloadURL parameter. |
| File is being processed, but is not ready for download. | Wait 0.5-1 second, before refreshing the page. |
| An unexpected error happened during processing and DDS is not able to produce a file. | Provide the user with an error message and contact Bokbasen. |
Curl example - ebook (curl)
...
Code Block | ||
---|---|---|
| ||
curl -i \ -H "Accept: application/json" \ -H "Authorization: Boknett TGT-27154-xSYlTutzpes5v32hOHKFcbmbGVAUkb3I5iZt21fAdO1qGJ3taK-login.boknett.noBearer <token>" \ -H "Date: Wed, 12 Aug 2015 09:22:00 GMT" \ 'https://api.bokbasen.io/dds.boknett.no/content/v1/755f943c-2644-413f-8e0c-4e16f38cfdf1' HTTP/1.1 302 Found Date: Wed, 12 Aug 2015 09:22:49 GMT Location: https://api.dds.boknett.no/download/bb3547bf-00e9-4e8a-8ba8-027a96390fd7/status |
...
Code Block | ||
---|---|---|
| ||
curl -i \ -H "Authorization: Boknett TGT-27311-RWtOZJ4KUBSflp0YxvZ5Kgg3EFpdJ1GbgUeKq9Ht2BmdCrPJoa-login.boknett.noBearer <token>" \ -H "Date: Wed, 12 Aug 2015 11:35:00 GMT" \ 'https://api.bokbasen.io/dds.boknett.no/content/v1/30311730-6bb0-43a1-809f-18735edec150' HTTP/1.1 300 Multiple Choices Content-Type: application/json Content-Length: 318 [{"type": "audio/vnd.bokbasen.zipped-public","bitrate": "64"}, {"type": "audio/vnd.bokbasen.zipped-private","bitrate": "64"}, {"type": "audio/vnd.bokbasen.complete-public","bitrate": "64"}, {"type": "audio/vnd.bokbasen.complete-private","bitrate": "64"}, {"type": "audio/vnd.bokbasen.hls-private","bitrate": "64"}, {"type": "audio/vnd.bokbasen.progressive-private","bitrate": "64"} ] |
...
Code Block | ||
---|---|---|
| ||
curl -i \ -H "Authorization: Boknett TGT-27311-RWtOZJ4KUBSflp0YxvZ5Kgg3EFpdJ1GbgUeKq9Ht2BmdCrPJoa-login.boknett.noBearer <token>" \ -H "Date: Wed, 12 Aug 2015 11:35:00 GMT" \ 'https://api.bokbasen.io/dds.boknett.no/content/v1/30311730-6bb0-43a1-809f-18735edec150?type=audio/vnd.bokbasen.progressive-private&bitrate=64' HTTP/1.1 302 Found Location: https://api.dds.boknett.dev.webbe.no/download/b2e6d465-8033-41d9-9021-4fb266a989e7/status |
...