Section | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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
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.
| fullData=true |
Results Structure
Metadata:
...
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
...
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
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
{ "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.
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
...
/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 |
|
/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 |
/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 |
| ||||||||||||||||||
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> |
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> |
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":
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 |