[Archivesspace_Users_Group] Example of programmatically updating /agents/people via REST?

Majewski, Steven Dennis (sdm7g) sdm7g at eservices.virginia.edu
Wed Apr 20 14:09:26 EDT 2016



archivesspace/aspace-client was originally and example of this sort of thing.  
Work was started on gemifiying that code to make it easier to write other scripts of that sort, and that example code was deleted, but it’s still in GitHub if you go back a version or two: 

https://github.com/archivesspace/aspace-client/blob/d15d091dfabfe6e455be03c32abeb664ce56a707/bulk_update.rb

( We need to get around to testing and adding examples back to that Gem someday! )


I posted a bash script to this list a while back that used jq(*) to update access group members. 
Not agents, but the same principles would apply. 

https://gist.github.com/sdm7g/93b9e072cffd398484ca



(*) ‘jq’ is kind of like ‘sed’ or ‘grep’ for JSON:  https://stedolan.github.io/jq/manual/v1.5/
   Very useful for debugging archivesspace backend. 


— Steve Majewski




> On Apr 20, 2016, at 1:46 PM, Mark Cyzyk <mcyzyk at jhu.edu> wrote:
> 
> Greetings!
> 
> Does anyone have a really good and clear example of how to update /agents/people via the REST API?  If so, I would love to see it.
> 
> We've extracted a chunk of JSON using the API, have modified parts of it, and now want to push it back in.
> 
> It's looking like, in order to do this, the pseudo-code would be something like:
> 
> Read edited JSON file
> Parse JSON
> Start a session with the ASpace server
> Begin loop over parsed JSON
>     Post each /agent/people item individually using its ID
> End loop
> Spin in chair
> 
> 
> That's what I'm working on now (but would love to see a working example [in Ruby or Python, preferably]).
> 
> Best regards,
> 
> Mark
> 
> -- 
> <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
> Mark Cyzyk, M.A., M.L.S.
> Scholarly Communication Architect
> User Interface Applications Group
> The Sheridan Libraries
> The Johns Hopkins University
> mcyzyk at jhu.edu
> 
> _______________________________________________
> 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