<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""><br class="">
</div>
<div class="">You can also append, for example: “?page=$PAGE&page_size=$SIZE” </div>
<div class="">The results array is wrapped in another layer of JSON: </div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-size: 16px; line-height: normal; color: rgb(105, 40, 40); background-color: rgb(255, 238, 219);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">{</b></span></div>
<div style="margin: 0px; font-size: 16px; line-height: normal; color: rgb(77, 43, 220); background-color: rgb(255, 238, 219);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">
</b></span><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">"first_page"</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">:
</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">1</span><span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">,</b></span></div>
<div style="margin: 0px; font-size: 16px; line-height: normal; color: rgb(77, 43, 220); background-color: rgb(255, 238, 219);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">
</b></span><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">"last_page"</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">:
</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">106</span><span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">,</b></span></div>
<div style="margin: 0px; font-size: 16px; line-height: normal; color: rgb(77, 43, 220); background-color: rgb(255, 238, 219);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">
</b></span><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">"this_page"</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">:
</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">40</span><span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">,</b></span></div>
<div style="margin: 0px; font-size: 16px; line-height: normal; color: rgb(77, 43, 220); background-color: rgb(255, 238, 219);" class="">
<span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">
</b></span><span style="font-variant-ligatures: no-common-ligatures" class=""><b class="">"results"</b></span><span style="font-variant-ligatures: no-common-ligatures; color: #692828" class=""><b class="">: [</b></span></div>
<div style="margin: 0px; font-size: 16px; line-height: normal; color: rgb(105, 40, 40); background-color: rgb(255, 238, 219);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class=""><b class=""> {</b></span></div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Most of the GET calls without an ID param in the URL take options:</div>
<div class=""><br class="">
</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>?all_ids=true # returns an array of id numbers</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>?page=n[&page_size=n] # returns an wrapped array of results</div>
<div class=""><span class="Apple-tab-span" style="white-space:pre"></span>?id_set=<span class="Apple-tab-span" style="white-space:pre">
</span># here you pass a list of ID numbers to return</div>
<div class=""><br class="">
</div>
<div class="">On the last, use the “-g” switch in curl so it passes the brackets thru without interpreting and use something like:</div>
<div class="">
<div style="margin: 0px; font-size: 16px; line-height: normal; background-color: rgb(255, 238, 219);" class="">
<span style="font-variant-ligatures: no-common-ligatures" class="">/agents/people?id_set[]=1055&_id_set[]=1056&id_set[]=1057"</span></div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">— Steve. </div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div>
<blockquote type="cite" class="">
<div class="">On Apr 1, 2016, at 10:47 AM, Kevin Clair <<a href="mailto:Kevin.Clair@du.edu" class="">Kevin.Clair@du.edu</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<div class="">
<div class="">Hi Eric,</div>
<div class=""><br class="">
</div>
<div class="">At Denver we do this by passing ‘all_ids=true’ as a parameter to get the array of all records of a certain type, then iterating over the array to download each record one by one. Code: <a href="https://github.com/duspeccoll/as_utils/blob/master/reports.rb" style="color: purple; text-decoration: underline;" class="">https://github.com/duspeccoll/as_utils/blob/master/reports.rb</a></div>
<div class=""><br class="">
</div>
<div class="">I haven’t found another way to do it but possibly others on the list have? -k</div>
<div class="">
<div id="MAC_OUTLOOK_SIGNATURE" class=""></div>
</div>
</div>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
<span id="OLK_SRC_BODY_SECTION" style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<div style="font-family: Calibri; font-size: 12pt; text-align: left; border-width: 1pt medium medium; border-style: solid none none; padding: 3pt 0in 0in; border-top-color: rgb(181, 196, 223);" class="">
<span style="font-weight: bold;" class="">From:<span class="Apple-converted-space"> </span></span><<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" style="color: purple; text-decoration: underline;" class="">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>>
on behalf of Eric Hanson <<a href="mailto:ehanson8@jhu.edu" style="color: purple; text-decoration: underline;" class="">ehanson8@jhu.edu</a>><br class="">
<span style="font-weight: bold;" class="">Reply-To:<span class="Apple-converted-space"> </span></span>Archivesspace Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" style="color: purple; text-decoration: underline;" class="">archivesspace_users_group@lyralists.lyrasis.org</a>><br class="">
<span style="font-weight: bold;" class="">Date:<span class="Apple-converted-space"> </span></span>Friday, April 1, 2016 at 8:34 AM<br class="">
<span style="font-weight: bold;" class="">To:<span class="Apple-converted-space"> </span></span>Archivesspace Group <<a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" style="color: purple; text-decoration: underline;" class="">archivesspace_users_group@lyralists.lyrasis.org</a>><br class="">
<span style="font-weight: bold;" class="">Subject:<span class="Apple-converted-space"> </span></span>[Archivesspace_Users_Group] Batch extraction of Agent records through the API<br class="">
</div>
<div class=""><br class="">
</div>
<div xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40" class="">
<div lang="EN-US" link="blue" vlink="purple" class="">
<div class="WordSection1" style="page: WordSection1;">
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
During some recent experimentation with the ArchivesSpace API, we found while that while you can use an array to remove multiple records for a DELETE request via the API, it seems like you can’t use an array with a GET request to retrieve multiple records as
JSON. Has anyone found a method for extracting multiple records through the API?<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
The reason we’re trying to do this is that we would like to download our Agent records and run them through an OpenRefine batch process to find potential VIAF identifiers based on the authorized name, review the VIAF identifiers for accuracy, and then push
the VIAF labels and identifiers back into the Agent records as alternate names.<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thanks!<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Eric Hanson<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Digital Content Metadata Specialist<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
The Sheridan Libraries<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Johns Hopkins University<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
3400 North Charles Street<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Baltimore, MD 21218<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
410-516-7756<o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<a href="mailto:ehanson8@jhu.edu" style="color: purple; text-decoration: underline;" class="">ehanson8@jhu.edu</a><o:p class=""></o:p></div>
<div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
</div>
</div>
</span><span style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""></span><span style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Archivesspace_Users_Group
mailing list</span><br style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" class="">Archivesspace_Users_Group@lyralists.lyrasis.org</a></span><br style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Calibri, sans-serif; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" class="">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a></span></div>
</blockquote>
</div>
<br class="">
</body>
</html>