[Archivesspace_Users_Group] cURL for bulk export of EAD in xml?

Mary Willoughby smirk at uga.edu
Wed Mar 18 13:46:17 EDT 2015


Thanks! I'll try out the script approach first before wading further 
into cURL.

On 3/18/2015 1:24 PM, Steven Majewski wrote:
>
>
> See this thread from January: [Archivesspace_Users_Group] curl help
> <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/2015-January/001059.html>
>
> The API call you want is :
>
> GET  /repositories/$REPO_ID/resource_descriptions/${ID}.xml?${PARAMS}
>
> ( where PARAMS may be something like: "include_daos=true&numbered_cs=true” )
>
>
> There isn’t one call to export all resources: You have to first do a
> call to
> GET  /repositories/$REPO_ID/resources?all_ids=true
> and loop thru the id’s returned with something like:
>
>
> for ID in $( curl -s -H "X-ArchivesSpace-Session:
> $session" "$REPO/repositories/$REPO_ID/resources?all_ids=true" | tail -1
> | tr '[],' ' ' )
> do
> curl  [ . .  . ]
>
>
>
> If you can directly login to the server, running the ead_export script
> may be easier.
> I have seen problems though if there is anything wrong with the exported
> EAD, you will
> get incomplete data when Nokogiri silently chokes on it. If you use the
> API calls,
> you will get a complete copy of the bad XML.  ( I saw this in the case I
> noted where
> ASpace inserts <p> tags incorrectly and exports malformed XML. )
>
> — Steve Majewski
>
>
>
> On Mar 18, 2015, at 12:52 PM, Mary Willoughby <smirk at uga.edu
> <mailto:smirk at uga.edu>> wrote:
>
>> Hi everyone,
>> I'm trying to bulk export EAD as xml using cURL to communicate with
>> the backend of our ArchivesSpace instance. I've gotten through the
>> very basic steps-- can connect, get session token, export session
>> token, login, and get details on specific repositories etc. What I'm a
>> little confused about is the specific syntax required to do a bulk
>> export of all the EAD from a given repository. Does anyone know of any
>> documentation/examples of this, or has anybody tried it and had it
>> work who would share the commands they used?  I've looked at the
>> thread from back in January and the HM screencasts about the backend
>> on youtube, and those have been a great help in getting this far, but
>> unfortunately I don't know enough about cURL to come up with the
>> string I need on my own. At least not so far.
>>
>> Thanks,
>> Mary Willoughby
>>
>> Digital Library of Georgia
>> _______________________________________________
>> Archivesspace_Users_Group mailing list
>> Archivesspace_Users_Group at lyralists.lyrasis.org
>> <mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
>> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>
>
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>



More information about the Archivesspace_Users_Group mailing list