Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

URLhttps://api.boknett.no/metadata/export/object
MethodGET
Request
headers

Authorization

Required

The token acquired from the Authentication Service.

Formated "Boknett TGT-...."

DateRequiredThe timestamp the request was made. Must comply with RFC 1123 date formats.
AcceptRequiredMust be "application/octet-stream"
Query
parameters
idRequiredAn 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-DispositionSuggests a default filename
Response
body
Object file
Returns200OK
403Forbidden
404Not Found
410Gone

 

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