[Archivesspace_Users_Group] ArchivesSpace API and XMLHttpRequests

Arnold, Hillel harnold at rockarch.org
Tue Feb 10 20:46:53 EST 2015


Hi everyone,
I’ve been hacking together a proof-of-concept single page web app which makes a couple of API calls against ArchivesSpace and returns/displays a bunch of data about a particular archival component.
Because I am not really a programmer, I’m just making a XMLHttpRequest with JQuery. However, I’m running into a couple problems.
First, when I try to post to my username and password so I can get back a session token, I’m getting an error related to cross domain requesting saying the requested resource doesn’t have an Access-Control-Allow-Origin header set. It seems like I’d need to set those header somewhere server-side (maybe in the app config settings somewhere), but I’m not sure where exactly that would be. The existing examples out there for working with the ArchivesSpace API seem to mostly be command-line tools, which wasn’t really helping me. I’m sure there are people out there who have done this, either specifically with ArchivesSpace or with other Ruby apps, so if you know how to do this or can point me to a link which tells me how to do it, I’d be most grateful!
Second, unless I am reading the documentation wrong (which is very likely), I think I should be able to make a get request like:
http://some_url:8089/search?q=cats&page=1 and get back search results. However, when I test that URL out in Postman I’m getting a 403 error. Am I missing something here?

Thanks for any help!

Hillel Arnold
Lead Digital Archivist
Rockefeller Archive Center
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150210/79835339/attachment.html>


More information about the Archivesspace_Users_Group mailing list