<div dir="ltr">Hi Hillel,<div><br></div><div>For development purposes, you can get around the cross domain issue by starting Chrome with the disable-web-security flag:</div><div><br></div><div><a href="http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome">http://stackoverflow.com/questions/3102819/disable-same-origin-policy-in-chrome</a><br></div><div><br></div><div>For the Postman case you described, it sounds like you need to hit the login endpoint first, get back the session key, and then add that to your search request headers (there's a little dropdown in Postman for this) using 'X-ArchivesSpace-Session' as the header key.</div><div><br></div><div>Hope this helps,</div><div><br></div><div>Brian</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 10, 2015 at 5:46 PM, Arnold, Hillel <span dir="ltr"><<a href="mailto:harnold@rockarch.org" target="_blank">harnold@rockarch.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif"><div>Hi everyone,</div><div>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.</div><div>Because I am not really a programmer, I’m just making a XMLHttpRequest with JQuery. However, I’m running into a couple problems.</div><div>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!</div><div>Second, unless I am reading the documentation wrong (which is very likely), I think I should be able to make a get request like:</div><div><a href="http://some_url:8089/search?q=cats&page=1" target="_blank">http://some_url:8089/search?q=cats&page=1</a> 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?</div><div><br></div><div>Thanks for any help!</div><span class="HOEnZb"><font color="#888888"><div><div><div><br></div><div>Hillel Arnold</div></div><div>Lead Digital Archivist</div><div>Rockefeller Archive Center</div></div></font></span></div>
<br>_______________________________________________<br>
Archivesspace_Users_Group mailing list<br>
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br>
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" target="_blank">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Brian Hoffman<br><a href="mailto:brianjhoffman@gmail.com">brianjhoffman@gmail.com</a></div>
</div>