<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Dallas,<br>
</p>
<p><br>
</p>
<p>What you describe is along the lines of what I had in mind with this plugin:<br>
</p>
<p><br>
</p>
<p><a href="https://github.com/mark-cooper/aspace-jsonmodel-from-format" id="LPlnk575064">https://github.com/mark-cooper/aspace-jsonmodel-from-format</a><br>
</p>
<p><br>
</p>
<p>It adds an endpoint to get an AS jsonmodel from a "raw" file (like an EAD xml file). You can then fire it back at the imports endpoint to get it into ArchivesSpace. In terms of validation, if the jsonmodel conversion fails then you wouldn't have anything
 to import and can log that. Use your preferred scripting language to do something like the examples for batch imports (in effect scripting a file by file import, rather than pushing a job which may fail part way through).<br>
</p>
<p><br>
</p>
<p>However, I haven't tested it with 1.2.0 so it may not be compatible with that version as is (but is
<em>probably</em> ok).<br>
</p>
<p><br>
</p>
<p>Best,<br>
</p>
<p>Mark<br>
</p>
<p><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<span dir="ltr"><font color="black" face="Calibri,Arial,Helvetica,sans-serif" size="3"><span style="font-size:12pt; background-color:white"><font face="Calibri,Arial,Helvetica,sans-serif"><font color="#282828" face="Calibri,Arial,Helvetica,sans-serif"><font color="#2F2F2F" face="Arial,sans-serif"></font></font></font></span></font></span></div>
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>Mark Cooper<br>
</div>
<div>Technical Lead, Hosting and Support<br>
</div>
<div>LYRASIS</div>
<div>email: mark.cooper@lyrasis.org</div>
<div>skype: mark_c_cooper​<br>
</div>
</div>
</div>
</div>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org> on behalf of Dallas Pillen
 <djpillen@umich.edu><br>
<b>Sent:</b> Monday, April 6, 2015 12:08 PM<br>
<b>To:</b> Archivesspace Users Group<br>
<b>Subject:</b> [Archivesspace_Users_Group] Import EAD via the API?</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hello all,
<div><br>
</div>
<div>I was curious if anyone has had any success starting EAD import jobs via the API?</div>
<div><br>
</div>
<div>I was thinking this could be done using POST /repositories/:repo_id/jobs_with_files described here: <a href="http://archivesspace.github.io/archivesspace/doc/file.API.html#post-repositoriesrepoidjobswithfiles">http://archivesspace.github.io/archivesspace/doc/file.API.html#post-repositoriesrepoidjobswithfiles</a></div>
<div><br>
</div>
<div>However, I am not entirely sure how the job and file parameters should be sent in the POST request, and I haven't seen anyone ask this question before or give an example of how it might work. I've tried sending the POST request several different ways and
 each time I am met with: {"error":{"job":["Parameter required but no value provided"],"files":["Parameter required but no value provided"]}}. </div>
<div><br>
</div>
<div>I suppose it's worth mentioning that the reason I want to do this is that, at some point, we will be importing several thousand EADs into ArchivesSpace. We're doing a lot of preliminary work to make our EADs import successfully, but know there will likely
 be some that will fail. Right now, the only way to do a batch import of EADs is to do a batch as a single import job. If one EAD in that job has an error, the entire job fails. For that reason, I would like to be able to import each EAD as a separate job so
 that the EADs that will import successfully will do so without being impacted by the EADs with errors. However, starting several thousand individual import jobs would be very tedious, and I'm looking for a way to automate that process. If anyone else has come
 up with any creative solutions or knows of a better way to do that than the API, I would be very interested to know.</div>
<div><br>
</div>
<div>The end goal would be to have a script that would batch start the import jobs, get the ID for each job, check up on the jobs every so often and, once there are no longer any active jobs, output some information about each of the jobs that failed. I've
 figured out how to do most of that using the API, but I'm stumped on how to get the whole process started.</div>
<div><br>
</div>
<div>Thanks!</div>
<div><br>
</div>
<div>Dallas<br>
<div><br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div style="font-size:12.8000001907349px"><b>Dallas Pillen<br>
</b>Project Archivist<b><br>
</b></div>
<div style="font-size:12.8000001907349px"><br>
</div>
<div style="font-size:12.8000001907349px; color:rgb(0,0,0)"><img height="40" width="351" style="-webkit-user-select: none;" src="https://webapps.lsa.umich.edu/dean/lsa_emails/bentley-sig-em.png"><br>
</div>
<div style="font-size:12.8000001907349px; color:rgb(0,0,0)"><font size="1">  <a href="http://bentley.umich.edu/" target="_blank" style="color:rgb(17,85,204)">Bentley Historical Library</a></font></div>
<div style="font-size:12.8000001907349px; color:rgb(0,0,0)"><font size="1">  1150 Beal Avenue</font></div>
<div style="font-size:12.8000001907349px; color:rgb(0,0,0)"><font size="1">  Ann Arbor, Michigan 48109-2113</font><span style="font-size:x-small"> </span></div>
<div style="font-size:12.8000001907349px"><a value="+17347643482" style="font-size:x-small"><font color="#000000">  </font></a><a value="+17347643482" style="color:rgb(34,34,34); font-size:x-small">734.647.3559</a></div>
<div style="font-size:12.8000001907349px; color:rgb(0,0,0)"><font size="1">  <a href="https://twitter.com/umichBentley" target="_blank" style="color:rgb(17,85,204)">Twitter</a> <a href="https://www.facebook.com/bentleyhistoricallibrary" target="_blank" style="color:rgb(17,85,204)">Facebook </a></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>