[Archivesspace_Users_Group] curl help

Noah Huffman noah.huffman at duke.edu
Tue Jan 20 09:32:56 EST 2015

Hi Ben,

I’m a curl novice too, but your last example should work to output a single EAD file to the current directory.  The only thing I see is that in your example you have a single quote to begin the URL and a double quote to end it.  Maybe change the double quote at the very end to a single quote, or make both double quotes?

Something like:

curl --output “EADfilename.xml” -H "X-ArchivesSpace-Session: $TOKEN" ‘http://aspace1prod.dlt.psu.edu:9089/repositories/3/resource_descriptions/9235.xml?numbered_cs=true’

This works for me in Windows Powershell.

More generally, I think it would be helpful for noobs like us if the ASpace documentation included a short primer (with examples) on how to use curl to interact with the API.  This could supplement the existing API documentation at: http://archivesspace.github.io/archivesspace/doc/file.API.html

The ASpace developer screencasts are a good reference if you haven’t seen them, particularly this one http://youtu.be/iKd4ZME1uIE?list=PLJFitFaE9AY_DDlhl3Kq_vFeX27F1yt6I


Noah Huffman
Archivist for Metadata and Encoding
David M. Rubenstein Rare Book & Manuscript Library
Duke University
noah.huffman at duke.edu<mailto:noah.huffman at duke.edu>

From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Ben Goldman
Sent: Monday, January 19, 2015 3:56 PM
To: Archivesspace Users Group
Subject: [Archivesspace_Users_Group] curl help

Hey All,

Wondering if anyone can help a cURL novice work through the process of exporting a finding aid from the API. I've reviewed some of the past emails on this subject from Noah and Kevin but I am still hung up somewhere. A quick recap:


        curl -F password='***' http://aspace1prod.dlt.psu.edu:9089/users/bmg17/login

Save token:


Just to verify I know what I am doing, try retrieving a resource record:

        curl -H "X-ArchivesSpace-Session: $token" 'http://aspace1prod.dlt.psu.edu:9089/repositories/3/resources/1352'

Success: {"lock_version":0,"title":"Frederick R. Matson papers","publish":true, etc. etc. etc.

I'm not going to do a mass publish yet, but went ahead and retrieved all the ids anyway:

       curl -H "X-ArchivesSpace-Session: $token" 'http://aspace1prod.dlt.psu.edu:9089/repositories/3/resources?all_ids=true'

A long list. Including a very short resource record with the id of 9235. Now I am wondering exactly how I put this together to export just this one. This is the command mentioned in previous messages:

        curl --output “resource_#1.xml” -H "X-ArchivesSpace-Session: $TOKEN" 'http://aspace1prod.dlt.psu.edu:9089/repositories/3/resource_descriptions/$ids.xml?numbered_cs=true"

I assume if I'm just exporting one, I can replace '$ids" with the actual number (9235), and that the value following --output can be whatever I want the finding aid file name to be. Is all this correct? And where would this actually output the file to?

Thanks, in advance, for any help.


Ben Goldman
Digital Records Archivist
Penn State University Libraries
University Park, PA

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

More information about the Archivesspace_Users_Group mailing list