...
Send an API key to the request as a bearer token in the Authorization header. Each unit will share an API key (see ENV['YPM_SECRET'] in the code below) with ITS.
An example in Ruby for creating the requestA curl example:
Code Block | ||
---|---|---|
| ||
require 'net/http' uri = URI(curl -O -H 'Authorization: Bearer TOKEN' 'http://images-dev.collections.yale.edu/iiif/2/ypm:85f1f218-30c1-48a4-8546-17d681f59c35.tif/full/20,/0/default.jpg') api_key = |
with TOKEN
replaced with the actual value of the API key
An example in Ruby:
Code Block | ||
---|---|---|
| ||
require 'net/http'
uri = URI('http://images-dev.collections.yale.edu/iiif/2/ypm:85f1f218-30c1-48a4-8546-17d681f59c35.tif/full/20,/0/default.jpg')
api_key = ENV['YPM_SECRET']
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{api_key}"
res = Net::HTTP.start(uri.hostname, uri.port,
use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
open('out.jpg', 'w') do |f|
f.write(res.read_body)
end |
Getting Stock TIFF Images
Code Block |
---|
https://media.collections.yale.edu/tiff/{unit}/{uuid}.tif |
...
Code Block |
---|
{ "unit": "YCBA", "cmsType": "obj", "cmsId": "1726", "metadata": [ { "label": "logo", "value": "https://static.britishart.yale.edu/images/ycba_logo.jpg" }, { "label": "label", "value": "Robert Dighton, 1752–1814, British, The Produce of Industry, undated" }, { "label": "rightsDescriptionRights URI", "value": "Data are in public domain, but separate rights restrictions may apply to individual images.https://creativecommons.org/publicdomain/zero/1.0/" }, { "label": "AttributionRights Description", "value": "Metadata describing Yale Center for British Art, Paul Mellon Collection,collections is public domain" under CC0. Copyright or other restrictions may apply to cultural works or images of those works in this record." }, { "label": "licenseCopyright Statement", "value": "http://hdl.handle.net/10079/w6m90dqCopyright Information" }, { "label": "Description",Image Use Rights URI", "value": "Twelve Illustrations to Contemporary Life and Diversions, Sheet: 6 5/8 × 10 7/8 inches (16.8 × 27.6 cm)http://rightsstatements.org/vocab/UND/1.0/" }, { "label": "CreatorImage Use Rights", "value": "Robert Dighton, 1752–1814, British" }, { "label": "Title", "value": "The Produce of Industry" }, { "label": "Physical Description", "value": "Sheet: 6 5/8 × 10 7/8 inches (16.8 × 27.6 cm)Copyright Undetermined: The copyright and related rights status of this Item has been reviewed by the organization that has made the Item available, but the organization was unable to make a conclusive determination as to the copyright status of the Item. Please refer to the organization that has made the Item available for more information. You are free to use this Item in any way that is permitted by the copyright and related rights legislation that applies to your use." }, { "label": "Credit LineAttribution", "value": "Yale Center for British Art, Paul Mellon Collection, public domain" }, { "label": "InstitutionDescription", "value": "YaleTwelve CenterIllustrations forto BritishContemporary Art"Life and Diversions, Sheet: 6 },5/8 × 10 7/8 inches (16.8 × 27.6 cm)" }, { "label": "CollectionCreator", "value": "Prints and DrawingsRobert Dighton, 1752–1814, British" }, { "label": "Call NumberTitle", "value": "B1986.29.81The Produce of Industry" }, { "label": "homepagePhysical Description", "value": ["Sheet: 6 5/8 × 10 7/8 inches (16.8 {× 27.6 cm)" }, { "@idlabel": "https://collections.britishart.yale.edu/catalog/tms:1726", Credit Line", "labelvalue": "catalog entry at the Yale Center for British Art",Yale Center for British Art, Paul Mellon Collection" }, { "formatlabel": "text/htmlInstitution", "value": "Yale }Center for ]British Art" }, { "label": "seeAlsoCollection", "value": ["Prints and Drawings" }, { { "@idlabel": "https://collections.britishart.yale.edu/oaicatmuseum/OAIHandler?verb=GetRecord&identifier=oai:tms.ycba.yale.edu:1726&metadataPrefix=lido", Call Number", "formatvalue": "text/xml",B1986.29.81" }, { "profilelabel": "http://www.lido-schema.org/schema/v1.0/lido-v1.0.xsd""homepage", "value": [ }, { "@id": "httphttps://collectioncollections.britishart.yale.edu/id/page/object/catalog/tms:1726", "formattype": "text/rdf+n3Text", } "label": "catalog entry at the ]Yale Center for British }Art", ] } |
Attributes
...
metadata
...
"format": "text/html"
}
]
},
{
"label": "seeAlso",
"value": [
{
"@id": "https://collections.britishart.yale.edu/oaicatmuseum/OAIHandler?verb=GetRecord&identifier=oai:tms.ycba.yale.edu:1726&metadataPrefix=lido",
"type": "Dataset",
"format": "text/xml",
"profile": "http://www.lido-schema.org/schema/v1.0/lido-v1.0.xsd"
},
{
"@id": "http://collection.britishart.yale.edu/id/page/object/1726",
"format": "text/rdf+n3"
}
]
}
]
}
|
Attributes
unit, cmsType, cmsId | These three values together uniquely defines an object, corresponding respectively to unitcode, cmstype, and cmsid in the dbo.assets table of TMAN database. | |
metadata |
| |
label | becomes the “label” for the whole manifest | |
Rights URI | goes to the top level “rights” field | |
Rights Description | goes into the top level “requiredStatement” field | |
Copyright Statement | ||
Image Use Rights URI | ||
Image Use Rights | ||
logo | goes to the top level “logo” field | |
homepage, seeAlso | goes to the top level “homepage”, “seeAlso” field respectively. Since these can have great variability among units, this field should be entered verbatim as should appear in the manifest, according to the API. See |