<html 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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.pl-s
{mso-style-name:pl-s;}
span.pl-s1
{mso-style-name:pl-s1;}
span.pl-kos
{mso-style-name:pl-kos;}
span.pl-v
{mso-style-name:pl-v;}
span.pl-en
{mso-style-name:pl-en;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">I did a lot of this back in the day, but it’s been a while – IIRC<br>
<br>
You post an array of objects matching the JSONModel schema in ArchivesSpace. If you’re referencing existing objects in the system, you use the existing URI in refs, if you’re creating an object, you give it an arbitrary URI which will be replaced on ingest,
and succeeding objects later in the array can reference that URI.<br>
<br>
For example, in this case, <a href="https://github.com/smith-special-collections/aspace-utils/blob/smith/resource_parser.rb#L389">
https://github.com/smith-special-collections/aspace-utils/blob/smith/resource_parser.rb#L389</a>, I give resource objects a URI that looks like "/repositories/import/resources/import_309r8sfoijw3409ruf0u40fg8" (using a UUID generator built into Ruby) so objects
later in the import can refer to the resource. <o:p></o:p></p>
<p class="MsoNormal"><br>
Does that make sense?<br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">--<o:p></o:p></p>
<p class="MsoNormal">Dave Mayo (he/him)<o:p></o:p></p>
</div>
<p class="MsoNormal">Senior Digital Library Software Engineer<br>
Harvard University > HUIT > LTS<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black"><archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of James R Griffin III <jrg5@princeton.edu><br>
<b>Reply-To: </b>Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Date: </b>Thursday, May 7, 2020 at 10:44 AM<br>
<b>To: </b>Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject: </b>Re: [Archivesspace_Users_Group] Question Regarding the REST API batch_imports Operation<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">I am terribly sorry, I have now found that the payload is a JSON serialization of an array of resource objects: <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_archivesspace_archivesspace_blob_master_backend_spec_controller-5Fbatch-5Fimport-5Fspec.rb-23L41&d=DwMFAg&c=WO-RGvefibhHBZq3fL85hQ&r=_Mv1dY22K7jvT5MD7xjbvGVzRDOUMhx4WYcnPSIzYnE&m=SD1vNNnvW50K-2ToZ2LG6v0WMDzSvtWkVtPSUsGe1DQ&s=QuevSa2HLjrjx745CQYyv4Y0PbFk6qft2LAcQnWW3hA&e=">https://github.com/archivesspace/archivesspace/blob/master/backend/spec/controller_batch_import_spec.rb#L41</a><br>
<br>
Would one then model the payload as one of these arrays of JSON objects, each with a URI internal to the EAD file?<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> James R Griffin III<br>
<b>Sent:</b> Thursday, May 7, 2020 10:30 AM<br>
<b>To:</b> Archivesspace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> Question Regarding the REST API batch_imports Operation</span> <o:p>
</o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">Hello Everyone,<br>
<br>
I have recently been reviewing the documentation for the REST API, and was looking to explore the possible usage of <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__archivesspace.github.io_archivesspace_api_-23import-2Da-2Dbatch-2Dof-2Drecords&d=DwMFAg&c=WO-RGvefibhHBZq3fL85hQ&r=_Mv1dY22K7jvT5MD7xjbvGVzRDOUMhx4WYcnPSIzYnE&m=SD1vNNnvW50K-2ToZ2LG6v0WMDzSvtWkVtPSUsGe1DQ&s=dGq0YS2NZFipST2vx-iyS3lD1XE3A2T2a6E7Iy0xGi8&e=">https://archivesspace.github.io/archivesspace/api/#import-a-batch-of-records</a><br>
<br>
Please forgive for my ignorance, but does the body of the POST request contain a payload of EAD XML? Would this be a string of concatenated EAD documents?<br>
<br>
Additionally, my understanding is that the response from this request contains an identifier for the created object. As the job for importing the records would be asynchronous, should one poll for the status of this new object by repeatedly transmitting a GET
request against <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__archivesspace.github.io_archivesspace_api_-23find-2Dresources-2Dby-2Dtheir-2Didentifiers&d=DwMFAg&c=WO-RGvefibhHBZq3fL85hQ&r=_Mv1dY22K7jvT5MD7xjbvGVzRDOUMhx4WYcnPSIzYnE&m=SD1vNNnvW50K-2ToZ2LG6v0WMDzSvtWkVtPSUsGe1DQ&s=LwavToKOM3wrwCBI_w1mdTISdSY6miulhZo8KqzKCek&e=">https://archivesspace.github.io/archivesspace/api/#find-resources-by-their-identifiers</a> until
it has been fully imported?<br>
<br>
Thank you for your patience and assistance.<br>
<br>
Sincerely,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">James<o:p></o:p></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div id="x_Signature">
<div>
<p><span style="color:black">-- <o:p></o:p></span></p>
<p><span style="color:black"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__my.pronoun.is_he&d=DwMFAg&c=WO-RGvefibhHBZq3fL85hQ&r=_Mv1dY22K7jvT5MD7xjbvGVzRDOUMhx4WYcnPSIzYnE&m=SD1vNNnvW50K-2ToZ2LG6v0WMDzSvtWkVtPSUsGe1DQ&s=VAXnUY7ASb1LRVVD0sS85_MiV_hViNjFJg_Wo8nVv48&e=" target="_blank">my.pronoun.is/he</a><o:p></o:p></span></p>
<p><span style="color:black">James R. Griffin III<o:p></o:p></span></p>
<p><span style="color:black">Digital Infrastructure Developer<o:p></o:p></span></p>
<p><span style="color:black"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__library.princeton.edu_&d=DwMFAg&c=WO-RGvefibhHBZq3fL85hQ&r=_Mv1dY22K7jvT5MD7xjbvGVzRDOUMhx4WYcnPSIzYnE&m=SD1vNNnvW50K-2ToZ2LG6v0WMDzSvtWkVtPSUsGe1DQ&s=AlDdy2Ij2dQGDc3IUBtPd3VWC7xTPfWxTdInfSXAvAo&e=">Princeton
University Library</a><o:p></o:p></span></p>
<p><span style="color:black">Princeton, NJ 08544<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>