LUNA API Documentation

There are two API's available:

LUNA Viewer API provides you with a convenient way to incorporate images from the LUNA Viewer into other web resources, like a website, wiki, blog, etc.

Record Data API allows for read, add, update and delete the record data contained within the LUNA Library.

On this page:

LUNA Viewer API

A JavaScript request and response API used to deliver search results from the LUNA Viewer. 

Let’s say you have an exhibition you’d like to highlight on your website and the images reside in the LUNA Viewer, you can select this subset of images from the LUNA Viewer and promote them on your site.  When a user clicks on one of the images they are taken to the LUNA Viewer. This LUNA Viewer API is a great way to bring your users into LUNA via your other web resources, primarily for images but will also support data. Example from the David Rumsey Historical Map Collection:

 Searching

Example URL

http://www.davidrumsey.com/luna/servlet/as/fetchMediaSearch?&sort=Pub_List_No_InitialSort%2CPub_Date%2CPub_List_No%2CSeries_No&lc=RUMSEY%7E8%7E1&fullData=true&bs=25&random=true&os=0&callback=updateQueue

 

Parameter

Description

Example

q

The query to run.  Specifying no query is the same as "view all." Query syntax is the same as is used by LUNA.  For fielded search, use the advanced search as a template.

q=test

or

q=Pub_Title=ohio

lc

Limit by collection. Luna collection IDs (Institution ID + "~" + Collection ID + "~" + Unique Collection ID), separated by comma.

lc=RUMSEY~8~1

or

lc=RUMSEY~8~1,LUNA~1~1

sort

Up to 4 Luna fields separated by comma. 

sort=Pub_List_No_InitialSort,

Pub_Date,Pub_List_No,

Series_No

mgid

Media Group ID -- use this to specify the ID # for a group

mgid=25

random

Whether to randomly sort the resultset.

true -- completely randomizes the order of the result set

false (default) -- uses the specified sort

random=true

os

Offset in result set. Used for paging.  Default is 0.

os=25

bs

Batch Size (# of results to return). Default is 10.

bs=25

callback

Javascript callback.  When the JSON data is returned, pass the data to the following function.

callback=myFunction

<script>

function myFunction(nodes)

{

var lst = nodes['data'];

if (lst == undefined) lst = nodes;

for (var i=0;i < lst.length;i++)

{

   ...

   }

}

mid

Getting data for a specific record.  Sometimes you just want data for one record without doing a search for it.  Use the LUNA ID for the record (everything after /detail/).

mid=RUMSEY~8~1~520~60062

fullData

false by default.  Setting this to true will include more data from the LUNA server instead of just the thumbnail images.

 

This must be used with individual records or an offset < 5.

fullData=true

Results Structure

Metadata:

Note : this section is only included when the callback parameter is used.

The meta object is returned at the beginning of the response and contains basic information about the request including: total # of results, collections searched, info about the collections. A textual description of the search, and the offset.

Data:

The data array contains one object for each result. The values included are:  

    • identity - the LUNA ID

    • mediaType - IMAGE, etc

    • urlSize0 - size 0 image URL

    • urlSize1 - size 1 image URL

    • urlSize2 - size 2 image URL

Additional values when fullData=true

    • displayName - the "title" field as mapped in the LAS

    • summary field values (the data shown in a mouse-over on a LUNA result set)

    • preview field values (the thumbnail labels)

    • urlSize3 - size 3 image URL

    • urlSize4 - size 4 image URL  

 

Click below to see the JSON result example
{
  "meta": {
    "totalNumberOfResults": "306",
    "collections": [
      {
        "totalMediaCount": 21352,
        "type": "legacy",
        "name": "David Rumsey Collection",
        "id": "RUMSEY~8~1"
      }
    ],
    "searchDescription": "Search Results: Pub Title equal to 'Ohio'",
    "pageSize": "25",
    "offset": "0",
    "random": "false"
  },
  "data": [
    {
      "summaryFieldValues": "[{\\\"summaryDescriptionFieldSort\\\":1,\\\"value\\\":\\\"Hutchins, Thomas\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":1},{\\\"summaryDescriptionFieldSort\\\":2,\\\"value\\\":\\\"A New Map of the Western Parts of Virginia, Pennsylvania, Maryland and North Carolina, Comprehending the River Ohio, and all the Rivers, which fall into it, Part of the River Mississippi, the Whole of the Illinois River, Lake Erie, Part of the Lakes Huron, Michigan&c. And all the Country bordering on these Lakes and Rivers. By Thos. Hutchins, Captain in the 60 Regiment of Foot. London, Published according to Act of Parliament Novembr. ye 1st, 1778 by T. Hutchins ... Engrav'd by T. Cheevers.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":3,\\\"value\\\":\\\"T. Hutchins\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":4,\\\"value\\\":\\\"This map was published separately and at the same time as Hutchins'\\\\\\\"Topographical Description...\\\\\\\" and should accompany the book. Streeter calls it \\\\\\\"by far the best map of the west printed to that time.\\\\\\\" It was the first large scale map of the area west of the Allegheny Mountains based on personal observations, although Hutchins gives credit to Lewis Evans'\\\\\\\"Map of the Middle Colonies\\\\\\\" as the best prior source of information about the area. The map contains extensive printed notes which describe important aspects of the country depicted. This map ranks with the most important American maps issued in the 18th century and is now rare. Hutchins later became the first Geographer of the United States. With outline color. Map is dissected into 32 sections and mounted on linen. Folds into new green cloth folding boards and quarter leather green cloth slip case 24x16 with \\\\\\\"Hutchin's New Map Of Western Parts Of Virginia, Etc. 1778\\\\\\\" on the spine in gold.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0}]",
      "previewFieldValues": "[{\\\"summaryDescriptionFieldSort\\\":1,\\\"value\\\":\\\"Hutchins, Thomas\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":1},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"The Western Parts of Virginia, Pennsylvania, Maryland and North Carolina.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":2},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"1778\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":3},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Case Map\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":4}]",
      "identity": "RUMSEY~8~1~281~30139",
      "urlSize0": "http://www.davidrumsey.com/rumsey/Size0/D0003/00030139.jpg?userid=5&username=rumsey-admin&resolution=0&servertype=JVA&cid=8&iid=RUMSEY&vcid=NA&usergroup=Rumsey-Admin&profileid=2",
      "fieldValues": "[{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"5044.000\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"1778\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":3},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"1,140,480\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"1778\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"1\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":1,\\\"value\\\":\\\"Hutchins, Thomas\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":1},{\\\"summaryDescriptionFieldSort\\\":2,\\\"value\\\":\\\"A New Map of the Western Parts of Virginia, Pennsylvania, Maryland and North Carolina, Comprehending the River Ohio, and all the Rivers, which fall into it, Part of the River Mississippi, the Whole of the Illinois River, Lake Erie, Part of the Lakes Huron, Michigan&c. And all the Country bordering on these Lakes and Rivers. By Thos. Hutchins, Captain in the 60 Regiment of Foot. London, Published according to Act of Parliament Novembr. ye 1st, 1778 by T. Hutchins ... Engrav'd by T. Cheevers.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Streeter 1300, P-Maps 983, Ristow p 38-39, Smith, p 20-27, Brown 51.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":4,\\\"value\\\":\\\"This map was published separately and at the same time as Hutchins'\\\\\\\"Topographical Description...\\\\\\\" and should accompany the book. Streeter calls it \\\\\\\"by far the best map of the west printed to that time.\\\\\\\" It was the first large scale map of the area west of the Allegheny Mountains based on personal observations, although Hutchins gives credit to Lewis Evans'\\\\\\\"Map of the Middle Colonies\\\\\\\" as the best prior source of information about the area. The map contains extensive printed notes which describe important aspects of the country depicted. This map ranks with the most important American maps issued in the 18th century and is now rare. Hutchins later became the first Geographer of the United States. With outline color. Map is dissected into 32 sections and mounted on linen. Folds into new green cloth folding boards and quarter leather green cloth slip case 24x16 with \\\\\\\"Hutchin's New Map Of Western Parts Of Virginia, Etc. 1778\\\\\\\" on the spine in gold.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"91\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"112\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"U.S. Mid West\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Case Map\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":4},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"0000_5044.000_001\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"5044000\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Hutchins, Thomas\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"1263855560464, 1263855560464, 1263855560464, 1263855560464, 1263855560464, 1263855560464, 1263855560464, 1263855560464\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"London\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Case Map\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Hutchins, Thomas\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"This map was published separately and at the same time as Hutchins'\\\\\\\"Topographical Description...\\\\\\\" and should accompany the book. Streeter calls it \\\\\\\"by far the best map of the west printed to that time.\\\\\\\" It was the first large scale map of the area west of the Allegheny Mountains based on personal observations, although Hutchins gives credit to Lewis Evans'\\\\\\\"Map of the Middle Colonies\\\\\\\" as the best prior source of information about the area. The map contains extensive printed notes which describe important aspects of the country depicted. This map ranks with the most important American maps issued in the 18th century and is now rare. Hutchins later became the first Geographer of the United States. With outline color. Map is dissected into 32 sections and mounted on linen. Folds into new green cloth folding boards and quarter leather green cloth slip case 24x16 with \\\\\\\"Hutchin's New Map Of Western Parts Of Virginia, Etc. 1778\\\\\\\" on the spine in gold.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"The Western Parts of Virginia, Pennsylvania, Maryland and North Carolina.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":2},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"1\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":3,\\\"value\\\":\\\"T. Hutchins\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"112\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"91\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Streeter 1300, P-Maps 983, Ristow p 38-39, Smith, p 20-27, Brown 51.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"Rumsey Collection\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"A New Map of the Western Parts of Virginia, Pennsylvania, Maryland and North Carolina, Comprehending the River Ohio, and all the Rivers, which fall into it, Part of the River Mississippi, the Whole of the Illinois River, Lake Erie, Part of the Lakes Huron, Michigan &c. And all the Country bordering on these Lakes and Rivers. By Thos. Hutchins, Captain in the 60 Regiment of Foot. London, Published according to Act of Parliament Novembr. ye 1st, 1778 by T. Hutchins ... Engrav'd by T. Cheevers.\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"18 Jan 2010 14:59:20 -0800, 18 Jan 2010 14:59:20 -0800, 18 Jan 2010 14:59:20 -0800, 18 Jan 2010 14:59:20 -0800, 18 Jan 2010 14:59:20 -0800, 18 Jan 2010 14:59:20 -0800, 18 Jan 2010 14:59:20 -0800, 18 Jan 2010 14:59:20 -0800\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0},{\\\"summaryDescriptionFieldSort\\\":0,\\\"value\\\":\\\"5044.000\\\",\\\"metaData\\\":false,\\\"previewFieldSort\\\":0}]",
      "misc": false,
      "docId": 0,
      "video": false,
      "urlSize2": "http://www.davidrumsey.com/rumsey/Size2/D0003/00032139.jpg?userid=5&username=rumsey-admin&resolution=2&servertype=JVA&cid=8&iid=RUMSEY&vcid=NA&usergroup=Rumsey-Admin&profileid=2",
      "id": "RUMSEY~8~1~281~30139",
      "attributes": "{\\\"empty\\\":false}",
      "urlSize1": "http://www.davidrumsey.com/rumsey/Size1/D0003/00031139.jpg?userid=5&username=rumsey-admin&resolution=1&servertype=JVA&cid=8&iid=RUMSEY&vcid=NA&usergroup=Rumsey-Admin&profileid=2",
      "audio": false,
      "description": "",
      "image": true,
      "mediaType": "IMAGE",
      "displayAttributeNames": "[\\\"displayTitle\\\"]",
      "displayName": "A New Map of the Western Parts of Virginia, Pennsylvania, Maryland and North Carolina, Comprehending the River Ohio, and all the Rivers, which fall into it, Part of the River Mississippi, the Whole of the Illinois River, Lake Erie, Part of the Lakes Huron, Michigan&c. And all the Country bordering on these Lakes and Rivers. By Thos. Hutchins, Captain in the 60 Regiment of Foot. London, Published according to Act of Parliament Novembr. ye 1st, 1778 by T. Hutchins ... Engrav'd by T. Cheevers."
    }
  ]
}



 

IIIF URLs

As of version 7.3.1 you can include IIIF URL's in the response.

LUNA Viewer API and IIIF

 

Record Data API

Read, add, update and delete the record data contained within the LUNA Library.

This API uses OAuth to authenticate access to the LUNA Library. Once authorized the OAuth user can view, add, edit and delete Record data from the LUNA Library based on the privileges the OAuth user has been granted.

The LUNA Record Data API is about making the LUNA system sync with your external cataloging system, or data source. For example, if you are cataloging your records in Filemaker the Record Data API allows this data to sync with LUNA. So if you need to make edits to records you can continue to do so in Filemaker and these edits will also be updated in LUNA. Alternately if you want to edit records in LUNA the edits will also be updated in Filemaker.

Using OAuth with LUNA Library

What is OAuth?

We think Yahoo sums it up quite well. OAuth is an open, simple, and secure protocol that enables applications to authenticate users and interact with LUNA on their behalf. The end user's information is securely transferred without revealing the identity of the user. At Luna, we use OAuth to verify that an application trying to interact with the LUNA Library on your behalf is doing so only with the permissions you have granted it.

To learn more about OAuth 1.0, please visit:
http://oauth.net/core/1.0/

Getting Started

To get started, first obtain a key and shared consumer secret for the application by registering it with the LUNA Library (Change the domain name and port number for your server) :

http://www.example.com:8181/editor/e/developers/apps

On this page, you are presented with a list of applications currently registered under the username you are logged in as.

When you click on 'Create', you will be asked the following:
App Name - the name of the application that's going to be interacting with the LUNA Library.

Callback URL(optional) - the default URL to redirect an authorized user back to the application when a callback URL is not provided along with the original request.

App Description(optional) - A short description of this application

On the next page, two values will be generated:
Key - a unique identifier of this application registered with the LUNA Library

Token secret - a shared secret which the application will use to compute signatures.

Keep in mind that the application will have access to the same set of collections as the user account under which this application is registered.

Making OAuth Requests

The URLs for requesting tokens and authorization are as follows:

http:// + hostname + port_number + /editor/e/oauth/request_token
http:// + hostname + port_number + /editor/e/oauth/authorize
http:// + hostname + port_number + /editor/e/oauth/access_token

References:

https://www.dropbox.com/developers/core/docs#request-token

http://www.flickr.com/services/api/auth.oauth.html

Using the Record data API

/collections/{collectionId} (GET)  

 

DESCRIPTION

Gets a list of “items” from the collection. An “item” can contain only media, only record, or both media and record if linked together. Use Get-Record request to retrieve full record data. Paging is possible with parameters.

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection

PARAMETERS

os The result offset. Server will return items starting from this number.


 

pgs The size of the results return. Default is 50.

METHOD

GET

ERROR

400 General Error

RETURNS

Sample XML response: (Click below to show)
<librarySearchResult>
    <item>
        <batchId>0</batchId>
        <collectionId>1</collectionId>
        <fileExt>jpg</fileExt>
        <fileName>CMA_.1986.7det02.jpg</fileName>
        <mediaId>19</mediaId>
        <status>0</status>
        <type>1</type>
        <typeString>Image</typeString>
      <url>http://myserver:8080/MediaManager/srvr?mediafile=/Size0/DIVAD~1~1/9/CMA_.1986.7det02.jpg</url>
        <url>http://myserver:8080/MediaManager/srvr?mediafile=/Size1/DIVAD~1~1/9/CMA_.1986.7det02.jpg</url>
        <url>http://myserver:8080/MediaManager/srvr?mediafile=/Size2/DIVAD~1~1/9/CMA_.1986.7det02.jpg</url>
        <committed>true</committed>
        <recordId/>
        <starred>false</starred>
    </item>
    <item>
        <batchId>0</batchId>
        <collectionId>0</collectionId>
        <mediaId>0</mediaId>
        <status>1</status>
        <type>0</type>
        <committed>true</committed>
        <recordId>2120</recordId>
        <starred>false</starred>
    </item>
    <totalResults>2</totalResults>
</librarySearchResult>


 

 

/collections/{collectionId} (POST)

 

Description

Uploads new record(s) to the specified collection.

URL Structure

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier of the collection

METHOD

POST

REQUEST BODY

(required)   The record(s) being uploaded in XML. The entire POST body will be treated as XML. Example:


 

   <recordList>

     <record>

       <field_name1>...</field_name1>

       <field_group_name1>

         <field_name2>...</field_name2>

       </field_group_name1>

     </record>

     ...

   </recordList>


 

ERROR

400 General error from processing uploaded records.

 

/collections/{collectionId}/records/{recordId}  (PUT)

 

DESCRIPTION

Update an existing record

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/records/<Record ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record

METHOD

PUT

REQUEST BODY

(required)   The record being updated in XML. Must contain exactly 1 record. The entire POST body will be treated as XML. Example:

 

   <recordList>

     <record>

       <field_name1>...</field_name1>

       <field_group_name1>

         <field_name2>...</field_name2>

       </field_group_name1>

     </record>

   </recordList>


ERROR

400   Invalid Record ID or content body contains more than 1 record


 

404 Unable to find record with the provided record ID

Creating or Updating records will trim leading and trailing whitespect characters from values

 

 /collections/{collectionId}/records/{recordId}  (DELETE)

 

DESCRIPTION

Delete an existing record

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/records/<Record ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record

METHOD

DELETE

ERROR

400 Invalid Record ID


 

404 Unable to find record with the provided record ID

 

/collections/{collectionId}/mappings/record/{recordId}/media/{mediaId} (POST)

 

DESCRIPTION

Create a mapping between a record and a media

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/mappings/record/<Record ID>/media/<Media ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record


 

Media ID   The unique identifier for the media

METHOD

POST

ERROR

400 Invalid Record ID or Media ID


 

404 No record found with the given Record ID

 

 

/collections/{collectionId}/mappings/record/{recordId}/media/{mediaId} (PUT)  

 

DESCRIPTION

Update existing mappings with the record. Any existing media currently linked to the record will be unlinked and replaced by this mapping.

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/mappings/record/<Record ID>/media/<Media ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record


 

Media ID   The unique identifier for the media

METHOD

PUT

ERROR

400 Invalid Record ID or Media ID


 

404 No record found with the given Record ID

 

/collections/{collectionId}/mappings/record/{recordId}/media/{mediaId} (DELETE)  

 

DESCRIPTION

Remove this mapping from the record. Other media that is linked to the record will be left untouched.

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/mappings/record/<Record ID>/media/<Media ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record


 

Media ID   The unique identifier for the media

METHOD

DELETE

ERROR

400 Invalid Record ID or Media ID


 

404 No record found with the given Record ID

 

/collections/{collectionId}/mappings/record/{recordId}/batch/{batchId}/filename/{filename} (POST)

 

DESCRIPTION

Create a mapping between a record and a media. Instead of providing Media ID, Batch ID and Filename is used in this request.

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/mappings/record/<Record ID>/batch/<Batch ID>/filename/<Filename>


 

LUNA Library Base URL The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record


 

Batch ID   The unique identifier for batch to which the media is uploaded


 

Filename The name of the media file.

METHOD

POST

ERROR

400 Invalid Record ID or Batch ID or Filename


 

404 No record found with the given Record ID

 


/collections/{collectionId}/mappings/record/{recordId}/batch/{batchId}/filename/{filename} (PUT)

 

DESCRIPTION

Update existing mappings with the record. Any existing media currently linked to the record will be unlinked and replaced by this mapping. Instead of providing Media ID, Batch ID and Filename is used in this request.

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/mappings/record/<Record ID>/batch/<Batch ID>/filename/<Filename>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record


 

Batch ID   The unique identifier for batch to which the media is uploaded


 

Filename The name of the media file.

METHOD

PUT

ERROR

400 Invalid Record ID or Batch ID or Filename


 

404 No record found with the given Record ID

 


/collections/{collectionId}/mappings/record/{recordId}/batch/{batchId}/filename/{filename} (DELETE)

 

DESCRIPTION

Remove this mapping from the record. Other media that is linked to the record will be left untouched. Instead of providing Media ID, Batch ID and Filename is used in this request.

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/mappings/record/<Record ID>/batch/<Batch ID>/filename/<Filename>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record


 

Batch ID   The unique identifier for batch to which the media is uploaded


 

Filename The name of the media file.

METHOD

DELETE

ERROR

400 Invalid Record ID or Batch ID or Filename


 

404 No record found with the given Record ID

 

/collections/{collectionId}/records/{recordId} (GET)

 

DESCRIPTION

Gets full data for a record

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/records/<Record ID>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Record ID   The unique identifier for the record

PARAMETER

rawMode DEFAULT 0. Set to 1 to return records in the same XML format as it is stored.

METHOD

GET

RETURNS

Sample XML response with rawMode = 0: (Click below to show)
<itemInfo>
    <itemID>2120</itemID>
    <collectionInfo>
        <uniqueCollectionId>1</uniqueCollectionId>
        <collectionID>1</collectionID>
        <institutionID>DIVAD</institutionID>
    </collectionInfo>
    <status>1</status>
    <batchId>32</batchId>
    <meta>
        <createdDate>2013-06-21T22:10:52Z</createdDate>
        <createdBy>1</createdBy>
        <createdAction>created</createdAction>
        <lastModDate>2013-06-21T22:10:52Z</lastModDate>
        <lastModBy>1</lastModBy>
        <lastModAction>loading record from C:\projects\LUNA\repository\DIVAD~1~1\File\Amicavison7.csv\Amicavison7.csv</lastModAction>
    </meta>
    <record>
        <archivision_template>
            <filename>list.txt</filename>
            <preferred_title>Glasgow Science Centre</preferred_title>
            <alternate_title>Glasgow Science Center</alternate_title>
            <image_view>Model of Glasgow Tower, on site</image_view>
            <creator>Building Design Partnership (British architectural firm, founded 1961); B?ro Happold (British structural engineering firm, founded 1977)</creator>
            <location>site: Glasgow, Scotland, United Kingdom</location>
            <location_note>south bank of the River Clyde; 50 Pacific Quay</location_note>
            <gps>51.564744</gps>
            <date>completed 2001 (creation)</date>
            <cultural_context>British; Scottish (Scots)</cultural_context>
            <style_period>Twenty-first century</style_period>
            <work_type>
                <work_type_1>mixed-use development</work_type_1>
                <work_type_2>motion picture theater</work_type_2>
                <work_type_3>museum</work_type_3>
            </work_type>
            <classification>architecture</classification>
            <material>titanium cladding; glass; steel</material>
            <technique>construction (assembling)</technique>
            <collection>Archivision Addition Module Seven</collection>
            <work_stateregion>Scotland</work_stateregion>
            <work_locationcountry>United Kingdom</work_locationcountry>
            <work_style_period>
                <work_styleperiod1>Twenty-first century</work_styleperiod1>
            </work_style_period>
            <agent_sortname>
                <agent1_sortname>Building Design Partnership</agent1_sortname>
            </agent_sortname>
        </archivision_template>
    </record>
</itemInfo>
Sample XML response with rawMode = 1: (Click below to show)
<itemInfo>
    <itemID>2127</itemID>
    <collectionInfo>
        <uniqueCollectionId>1</uniqueCollectionId>
        <collectionID>1</collectionID>
        <institutionID>DIVAD</institutionID>
    </collectionInfo>
    <status>1</status>
    <batchId>35</batchId>
    <entityList>
        <entity name="archivision_template">
            <field name="filename">
                <value>list.txt</value>
            </field>
            <field name="preferred_title">
                <value>Glasgow Science Centre</value>
            </field>
            <field name="image_view">
                <value>Model of Glasgow Tower, on site</value>
            </field>
            <field name="creator">
                <value>Building Design Partnership (British architectural firm, founded 1961); B?ro Happold (British structural engineering firm, founded 1977)</value>
            </field>
            <field name="date">
                <value>completed 2001 (creation)</value>
            </field>
            <field name="cultural_context">
                <value>British; Scottish (Scots)</value>
            </field>
            <field name="style_period">
                <value>Twenty-first century</value>
            </field>
            <entity name="work_type">
                <field name="work_type_1">
                    <value>mixed-use development</value>
                </field>
                <field name="work_type_2">
                    <value>motion picture theater</value>
                </field>
                <field name="work_type_3">
                    <value>museum</value>
                </field>
            </entity>
            <field name="work_stateregion">
                <value>Scotland</value>
            </field>
            <field name="work_locationcountry">
                <value>United Kingdom</value>
            </field>
            <entity name="work_style_period">
                <field name="work_styleperiod1">
                    <value>Twenty-first century</value>
                </field>
            </entity>
            <entity name="agent_sortname">
                <field name="agent1_sortname">
                    <value>Building Design Partnership</value>
                </field>
            </entity>
        </entity>
    </entityList>
    <meta>
        <createdDate>2013-06-21T22:10:52Z</createdDate>
        <createdBy>1</createdBy>
        <createdAction>created</createdAction>
        <lastModDate>2013-06-21T22:10:52Z</lastModDate>
        <lastModBy>1</lastModBy>
        <lastModAction>loading record from C:\projects\LUNA\repository\DIVAD~1~1\File\Amicavison7.csv\Amicavison7.csv</lastModAction>
    </meta>
</itemInfo>



 
 

ERROR

400 Invalid Record ID

 

/collections/{collectionId}/records (GET)

 

DESCRIPTION

Gets full data for a record

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/records


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection

PARAMETER

search_field (required) The name of the field to perform the search


 

search_value (required) The value to find in the specified field


 

os The result offset. Server will return items starting from this number.  


 

pgs The size of the results return. Default is 50.  

METHOD

GET

RETURNS

Sample XML Response:

 

<librarySearchResult>
   <item>
       <batchId>0</batchId>
       <lunaCollectionId>
           <collectionId>1</collectionId>
           <institutionId>DIVAD</institutionId>
           <uniqueCollectionId>1</uniqueCollectionId>
       </lunaCollectionId>
       <mediaId>0</mediaId>
       <status>1</status>
       <type>0</type>
       <committed>true</committed>
       <recordId>2120</recordId>
       <starred>false</starred>
   </item>
   <totalResults>1</totalResults>
</librarySearchResult>


 

ERROR

400 Invalid search parameters

 

/collections/{collectionId}/batch/{batchId}/filename/{filename} (GET)

 

DESCRIPTION

Get a media in a batch using filename

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/batch/<Batch ID>/filename/<Filename>


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection


 

Batch ID   The unique identifier for the batch where the media exists


 

Filename The name of the media file

METHOD

GET

RETURNS

Sample XML Response:

 

<librarySearchResult>
   <item>
       <batchId>0</batchId>
       <fileExt>jpg</fileExt>
       <fileName>4.jpg</fileName>
       <lunaCollectionId>
           <collectionId>8</collectionId>
           <institutionId>DIVAD1</institutionId>
           <uniqueCollectionId>8</uniqueCollectionId>
       </lunaCollectionId>
       <mediaId>8833</mediaId>
       <status>1</status>
       <type>1</type>
       <typeString>Image</typeString>
       <url>http://192.168.1.168:8080/MediaManager/srvr?mediafile=/Size0/DIVAD1~8~8/64/4.jpg</url>
       <url>http://192.168.1.168:8080/MediaManager/srvr?mediafile=/Size1/DIVAD1~8~8/64/4.jpg</url>
       <url>http://192.168.1.168:8080/MediaManager/srvr?mediafile=/Size2/DIVAD1~8~8/64/4.jpg</url>
       <committed>true</committed>
       <starred>false</starred>
   </item>
   <totalResults>1</totalResults>
</librarySearchResult>

 
 

ERROR

400 Invalid batch ID or filename

 

/collections/{collectionId}/entities (POST)

 

DESCRIPTION

Adds an entity(field group) to record(s) that match the given criteria

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/entities


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection

PARAMETER

parent_field_name (required) The name of the field whose entity under which you are adding the new entity


 

parent_field_value (required) The value of the field whose entity under which you are adding the new entity


 

search_field The name of the field to perform the search. Use this parameter to filter the number of records to update.


 

search_value The value of the field to perform the search. Use this parameter to filter the number of records to update.

METHOD

POST

ERROR

400 General Error

PHP EXAMPLE

To add a field group with name "Keywords" that contains a field called "Keyword" with value "painting":

$data='<keywords><keyword>painting</keyword></keywords>';

$url = $_SESSION['server_address'] . "/editor/e/api/collections/" . $collection_id
		 . "/entities?parent_field_name=work_record_id&parent_field_value=0052891"
		 ."&search_field=work_record_id&search_value=0052891";
		
$oauth->fetch($url, $data, OAUTH_HTTP_METHOD_POST, array('Content-Type' => 'text/plain'));

In this example, the "Keywords" field group is located at the top level with reference to the catalog template, "Work

Record ID" is a unique identifier that is also not inside any field group. Therefore, Parent Field and Search Field

and their values are the same. In the case of adding nesting field groups, they will differ.

 

/collections/{collectionId}/entities (PUT)

 

DESCRIPTION

Updates an entity (field group) in record(s) that match the given criteria

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/entities


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection

PARAMETER

search_entity_field (required) The name of the field within the entity that is being replaced. Use with search_entity_value to locate the target entity within the record.


 

search_entity_value (required) The value of the field within the entity that is being replaced. Use with search_entity_field to locate the target entity within the record.


 

search_field The name of the field to perform the search. Use this parameter to filter the number of records to update.  


 

search_value The value of the field to perform the search. Use this parameter to filter the number of records to update.  


 

parent_field_name  The name of the field in the parent of the entity that is being replaced. Use this with parent_field_value in case of repeating entities in a nested structure to uniquely identify the target entity.


 

parent_field_value  The value of the field in the parent of the entity that is being replaced. Use this with parent_field_name in case of repeating entities in a nested structure to uniquely identify the target entity.

METHOD

PUT

ERROR

400 General Error

 

/collections/{collectionId}/entities (DELETE)

 

DESCRIPTION

Deletes an entity(field group) in record(s) that match the given criteria

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/collections/<Collection ID>/entities


 

LUNA Library Base URL   The server address and port number to the Luna installation


 

Collection ID The unique identifier for the collection

PARAMETER

parent_field_name The name of the field whose entity under which you are deleting the entity  


 

parent_field_value The value of the field whose entity under which you are deleting the entity  


 

search_field The name of the field to perform the search. Use this parameter to filter the number of records to update.  


 

search_value The value of the field to perform the search. Use this parameter to filter the number of records to update.  


 

search_entity_field (required)


 

search_entity_value (required)

METHOD

DELETE

ERROR

400 General Error

 

/ping  

 

DESCRIPTION

Checks that the server is alive

URL STRUCTURE

http://<LUNA Library Base URL>/editor/e/api/ping


 

LUNA Library Base URL   The server address and port number to the Luna installation

METHOD

GET

ERROR

400 General Error