[Archivesspace_Users_Group] Batch extraction of Agent records through the API

Eric Hanson ehanson8 at jhu.edu
Fri Apr 1 11:16:07 EDT 2016


Thank you Kevin and Steve, those are both really helpful!

Eric

From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Majewski, Steven Dennis (sdm7g)
Sent: Friday, April 01, 2016 11:05 AM
To: Archivesspace Users Group
Subject: Re: [Archivesspace_Users_Group] Batch extraction of Agent records through the API


You can also append, for example: “?page=$PAGE&page_size=$SIZE”
The results array is wrapped in another layer of JSON:

{
  "first_page": 1,
  "last_page": 106,
  "this_page": 40,
  "results": [
    {


Most of the GET calls without an ID param in the URL take options:

?all_ids=true   # returns an array of id numbers
?page=n[&page_size=n]   # returns an wrapped array of results
?id_set=
# here you pass a list of ID numbers to return

On the last, use the “-g” switch in curl so it passes the brackets thru without interpreting and use something like:
/agents/people?id_set[]=1055&_id_set[]=1056&id_set[]=1057"


— Steve.



On Apr 1, 2016, at 10:47 AM, Kevin Clair <Kevin.Clair at du.edu<mailto:Kevin.Clair at du.edu>> wrote:

Hi Eric,

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: https://github.com/duspeccoll/as_utils/blob/master/reports.rb

I haven’t found another way to do it but possibly others on the list have?  -k

From: <archivesspace_users_group-bounces at lyralists.lyrasis.org<mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org>> on behalf of Eric Hanson <ehanson8 at jhu.edu<mailto:ehanson8 at jhu.edu>>
Reply-To: Archivesspace Group <archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>>
Date: Friday, April 1, 2016 at 8:34 AM
To: Archivesspace Group <archivesspace_users_group at lyralists.lyrasis.org<mailto:archivesspace_users_group at lyralists.lyrasis.org>>
Subject: [Archivesspace_Users_Group] Batch extraction of Agent records through the API

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?

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.

Thanks!

Eric Hanson
Digital Content Metadata Specialist
The Sheridan Libraries
Johns Hopkins University
3400 North Charles Street
Baltimore, MD 21218
410-516-7756
ehanson8 at jhu.edu<mailto:ehanson8 at jhu.edu>

_______________________________________________
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20160401/956ad230/attachment.html>


More information about the Archivesspace_Users_Group mailing list