[Archivesspace_Users_Group] Question Regarding the REST API batch_imports Operation
Majewski, Steven Dennis (sdm7g)
sdm7g at virginia.edu
Thu May 7 11:24:31 EDT 2020
(In the backend:)
EADConverter takes an EAD file (.xml) and produces a JSON file on resources: archival_objects, a parent resource record and possibly global subjects and agents. I’m not sure if there is a backend API call to do just this initial step, but you can run it from pry/irb with something like:
converter = EADConverter.new( eadxml )
converter.run
converter.get_output_path
That JSON output is what batch_import takes.
The JSON records temporary identifiers to link them together, and on import those links are converted to identifiers in the current repository namespace.
So it’s typically many resource records representing one EAD file.
However, I think from the way it’s implemented that it would work on a collection of records no matter whether they were related.
— Steve.
> On May 7, 2020, at 10:44 AM, James R Griffin III <jrg5 at princeton.edu> wrote:
>
> I am terribly sorry, I have now found that the payload is a JSON serialization of an array of resource objects: https://github.com/archivesspace/archivesspace/blob/master/backend/spec/controller_batch_import_spec.rb#L41 <https://github.com/archivesspace/archivesspace/blob/master/backend/spec/controller_batch_import_spec.rb#L41>
>
> Would one then model the payload as one of these arrays of JSON objects, each with a URI internal to the EAD file?
> From: James R Griffin III
> Sent: Thursday, May 7, 2020 10:30 AM
> To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
> Subject: Question Regarding the REST API batch_imports Operation
>
> Hello Everyone,
>
> I have recently been reviewing the documentation for the REST API, and was looking to explore the possible usage of https://archivesspace.github.io/archivesspace/api/#import-a-batch-of-records <https://archivesspace.github.io/archivesspace/api/#import-a-batch-of-records>
>
> 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?
>
> 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 https://archivesspace.github.io/archivesspace/api/#find-resources-by-their-identifiers <https://archivesspace.github.io/archivesspace/api/#find-resources-by-their-identifiers> until it has been fully imported?
>
> Thank you for your patience and assistance.
>
> Sincerely,
> James
>
> --
> my.pronoun.is/he <http://my.pronoun.is/he>
> James R. Griffin III
> Digital Infrastructure Developer
> Princeton University Library <https://library.princeton.edu/>
> Princeton, NJ 08544
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20200507/c97ce79c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3342 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20200507/c97ce79c/attachment.bin>
More information about the Archivesspace_Users_Group
mailing list