Overview

I had the opportunity to try the IIIF Content State API, so this is a memo of the process.

https://iiif.io/api/content-state/1.0/

The IIIF Content State API is described in Current Awareness-R as follows:

“The IIIF Content State API” can generate links that specify in detail how an object should be displayed, including rotation angle and display position on the page image.

https://current.ndl.go.jp/car/45832

Trying It Out

The “Shueitai / Letterpress Printing Digital Library” provides the IIIF Content State API.

https://archives.ichigaya-letterpress.jp/library/

Documentation is available at the following location.

https://archives.ichigaya-letterpress.jp/library/help

Below is an explanation of usage examples.

Item Detail Page

For example, access the following page.

https://archives.ichigaya-letterpress.jp/library/items/084cef1f7ddc

Then click the link to the IIIF Curation Viewer.

Rectangle Selection

Use the IIIF Curation Viewer to select a rectangle.

For instructions on using the IIIF Curation Viewer, please refer to the following.

http://ch-suzuki.com/icpt/index.html

Skipping a few steps, you can obtain the following information.

https://archives.ichigaya-letterpress.jp/api/presentation/2/084cef1f7ddc/canvas/2#xywh=2148,813,312,304

The above is in the following format:

#xywh=,,,

Base64 Encoding

For example, access the following site.

https://www.base64encode.org/

Then, using the previously obtained information and the manifest URI of the item, encode the following JSON.

{
    "id": "https://archives.ichigaya-letterpress.jp/api/presentation/2/084cef1f7ddc/canvas/2#xywh=2148,813,312,304",
    "type": "Canvas",
    "partOf": [{
        "id": "https://archives.ichigaya-letterpress.jp/api/presentation/2/084cef1f7ddc/manifest.json",
        "type": "Manifest"
    }]
}

As a result, the following string is obtained.

ewogICAgImlkIjogImh0dHBzOi8vYXJjaGl2ZXMuaWNoaWdheWEtbGV0dGVycHJlc3MuanAvYXBpL3ByZXNlbnRhdGlvbi8yLzA4NGNlZjFmN2RkYy9jYW52YXMvMiN4eXdoPTIxNDgsODEzLDMxMiwzMDQiLAogICAgInR5cGUiOiAiQ2FudmFzIiwKICAgICJwYXJ0T2YiOiBbewogICAgICAgICJpZCI6ICJodHRwczovL2FyY2hpdmVzLmljaGlnYXlhLWxldHRlcnByZXNzLmpwL2FwaS9wcmVzZW50YXRpb24vMi8wODRjZWYxZjdkZGMvbWFuaWZlc3QuanNvbiIsCiAgICAgICAgInR5cGUiOiAiTWFuaWZlc3QiCiAgICB9XQp9

Accessing the Endpoint URL

Using the above string, access the following URL.

https://archives.ichigaya-letterpress.jp/library/items/084cef1f7ddc?target=ewogICAgImlkIjogImh0dHBzOi8vYXJjaGl2ZXMuaWNoaWdheWEtbGV0dGVycHJlc3MuanAvYXBpL3ByZXNlbnRhdGlvbi8yLzA4NGNlZjFmN2RkYy9jYW52YXMvMiN4eXdoPTIxNDgsODEzLDMxMiwzMDQiLAogICAgInR5cGUiOiAiQ2FudmFzIiwKICAgICJwYXJ0T2YiOiBbewogICAgICAgICJpZCI6ICJodHRwczovL2FyY2hpdmVzLmljaGlnYXlhLWxldHRlcnByZXNzLmpwL2FwaS9wcmVzZW50YXRpb24vMi8wODRjZWYxZjdkZGMvbWFuaWZlc3QuanNvbiIsCiAgICAgICAgInR5cGUiOiAiTWFuaWZlc3QiCiAgICB9XQp9

As a result, you can access the following page.

Summary

As intended by the IIIF Content State API, we were able to create a link that specifies in detail how an object should be displayed.

There may be more efficient ways to create links, but I hope this serves as a helpful reference.