Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
Info

New Authentication & URLs introduced Q2 2024

Object Report

The objects (images and audio files) report contains identifiers and references to the address where the objects can be downloaded. These references will be valid for a limited period of time. The typical use of the object services is as follows:

  1. Authenticate (same for all services)

  2. Request report (list) of updated objects

  3. Parse list of updated objects (obtain URL to download service for each object)

  4. Download actual objects from download service (one or more requests per object) 

MethodRequired

URL

https://api.boknettbokbasen.noio/metadata/export/object/v1

Expand
GET
title

Request
headers

Authorization

Legacy

https://api.boknett.no/metadata/export/object

The token acquired from the Authentication Service.

Formated "Boknett TGT-...."

Date

Required

Required header: Date . The timestamp the request was made. Must comply with RFC 1123 date formats.

Method

GET

Request
headers

Authorization

Required

The token acquired from the Authentication Service.

Audience: https://api.bokbasen.io/metadata/

Formated "Bearer …"

Query
parameters

next

Required*

All data elements modified after this “cursor”. The cursor is in a not human readable format.

after

Required*

All data elements modified after this timestamp. The timestamp is on the format yyyyMMddHHmmss.

pagesize

Optional

See Pagination

Response
headers


Next

See Pagination

Link

See Pagination

Response
body

XML (Object metadata)

Returns

200

OK

400

Bad Request

401

Unauthorized

403

Forbidden

406

Not Acceptable

500

Internal Server Error

...

Object Download Service
Status
colourPurple
titleDeprecated

Expand
titleLegacy details

No longer need to download objects

There is now no need to download resources and host yourself. Just use the public available URL that comes in ONIX directly in customer facing solutions.

  • Cover Images are now hosted with public available URLs

  • Audio Samples are now hosted with public available URLs

The Object Download Service provides an endpoint for downloading binary object resources. The path to this service, as well as a unique identifier of the requested object, is returned from the object metadata service, which therefore must be called in advance. The unique identifier is only valid for a certain amount of time, as described in the table below, and can only be called by the same user (credentials) that requested the object export metadata service. The following details the parameters, example usage and different responses when using this service.

URL

https://api.boknett.no/metadata/export/object/download

Method

GET

Request
headers

Authorization

Required

The token acquired from the Authentication Service.

Formated "Boknett TGT-...."

Date

Required

The timestamp the request was made. Must comply with RFC 1123 date formats.

Accept

Required

Must be "application/octet-stream"

Query
parameters

id

Required

An unpredictable generated identifier that uniquely references an object representation. Returned in the response from the Object Report Service. Valid for a limited time.

Response
header

Content-Disposition

Suggests a default filename

Response
body

Object file

Returns

200

OK

403

Forbidden

404

Not Found

410

Gone

Object sample

Request objects report and thereafter download service

Code Block
> curl -i -H "Authorization: Boknett TGT-1947-CEwDRwvOiIodyeov31sMnHTn7XxbZH15GDhJDdKWAq1rELH5wU-login.boknett.no" -H "Date: Thu, 12 Jun 2014 13:46:16 GMT" 'https://api.boknett.no/metadata/export/object/?after=20140501000000'

Date: Thu, 12 Jun 2014 13:49:22 GMT
Server: Apache-Coyote/1.1
Next: MTI1MTU0YWE4MDMzIzE0Njc1YmNmZTU3IzhmMzEyZDM=
Link: <https://api.boknett.no/metadata/export/object?next=MTI1MTU0YWE4MDMzIzE0Njc1YmNmZTU3IzhmMzEyZDM=&pagesize=5000>; rel="next"
Content-Type: application/xml
Via: 1.1 api.boknett.no
Transfer-Encoding: chunked
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OBJECTS>
    <OBJECT>
        <ISBN13>9788202437930</ISBN13>
        <EAN>9788202437930</EAN>
        <FSSN>150157628</FSSN>
        <VAREEIER_KODE>0008</VAREEIER_KODE>
        <TYPE>os</TYPE>
        <REFERENCE>https://api.boknett.no/metadata/export/object/download?id=xpgZ1kLIardQ%2FWMwitZy02GAyCZzNsnIQTvZSf5LTk6GFDdIAaMGqkXxYoPVCIfy</REFERENCE>
    </OBJECT>
   ...
</OBJECTS>
 
> curl -JO -H "Accept: application/octet-stream" -H "Authorization: Boknett TGT-1947-CEwDRwvOiIodyeov31sMnHTn7XxbZH15GDhJDdKWAq1rELH5wU-login.boknett.no" -H "Date: Thu, 12 Jun 2014 13:49:22 GMT" https://api.boknett.no/metadata/export/object/download?id=xpgZ1kLIardQ%2FWMwitZy02GAyCZzNsnIQTvZSf5LTk6GFDdIAaMGqkXxYoPVCIfy
 
curl: Saved to filename 'os.jpg'
 

Note: The -JO flag tells curl to use the server-specified Content-Disposition filename. The response headers are not visible in the above curl command but looks like this:

Code Block
HTTP/1.1 200 OK
Date: Thu, 12 Jun 2014 13:49:22 GMT
Server: Apache-Coyote/1.1
Content-Disposition: attachment; filename="os.jpg"
Content-Type: application/octet-stream
Content-Length: 28805
Via: 1.1 api.boknett.no

Changes to filename

In case you still want to fetch these files and host them your selves, please make some adjustments.

...

Code Block
# In case you use this command (used when resource was protected/time-limited)
curl -JO \
     -H "Accept: application/octet-stream" -H\
"Authorization: Boknett TGT-1947-CEwDRwvOiIodyeov31sMnHTn7XxbZH15GDhJDdKWAq1rELH5wU-login.boknett.no" -H "Date: Thu, 12 Jun 2014 13:49:22 GMT" https://sr.bokbasen.io/coverimage/9783836574228/w360/jpg

# CHANGE
curl: Saved to filename 'jpg' (not as 'os.jpg')

...

Code Block
# In case you use this command (used when resource was protected/time-limited)
curl -JO \
     -H "Accept: application/octet-stream" -H\
"Authorization: Boknett TGT-1947-CEwDRwvOiIodyeov31sMnHTn7XxbZH15GDhJDdKWAq1rELH5wU-login.boknett.no" -H "Date: Thu, 12 Jun 2014 13:49:22 GMT" https://sr.bokbasen.io/audiosample/9788202362270.mp3

# CHANGE
curl: Saved to filename '9788202362270.mp3' (not as 'ly.mp3')