[Archivesspace_Users_Group] cannot retrieve list of resources in repo
Chris Fitzpatrick
Chris.Fitzpatrick at lyrasis.org
Wed May 7 08:27:47 EDT 2014
Hi Paul,
Sorry, there a bit of a gap in the documentation there...resources are paginated, since trying to get all the resources out of a big repo would be a very large request.
Take a look at the response:
$ curl -H "X-ArchivesSpace-Session: $TOKEN" "http://localhost:8089/repositories/2/resources"
{"error":{"page":["Parameter required but no value provided"],"id_set":["Parameter required but no value provided"],"all_ids":["Parameter required but no value provided"]}}
You need to either pass a page, id_set, or all_ids parameter
like:
$ curl -H "X-ArchivesSpace-Session: $TOKEN" "http://localhost:8089/repositories/2/resources?page=1"
I will update the documentation there...
b,chris.
Chris Fitzpatrick | chris.fitzpatrick at lyrasis.org
Developer, ArchivesSpace
http://archivesspace.org/
________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Ruderman, Paul <pruderman at ushmm.org>
Sent: Tuesday, May 06, 2014 8:38 PM
To: archivesspace_users_group at lyralists.lyrasis.org
Subject: [Archivesspace_Users_Group] cannot retrieve list of resources in repo
Hello,
I am trying to retrieve a list of resources inside my repository using the REST interface.
I am successfully logging in and using the returned session id to authenticate subsequent requests. (At least I it seems to be working.)
I had been previously receiving:
/repositories/1 => 200 OK
/repositories/1/resources => 400 Bad Request
/repositories/1/resources/1 => 403 Forbidden
Now (after supplying the session id via HTTP header):
/repositories/1 => 200 OK
/repositories/1/resources => 400 Bad Request
/repositories/1/resources/1 => 200 OK
As far as I can tell, this seems to be in accordance with the documentation. Why am I getting a 400 Bad Request when attempting to get a list of the available resources within the repository? The documentation says this call only can return 200 OK.
Any help would be greatly appreciated.
Paul J. Ruderman Digital Collections Developer, Digital Collections 202.314.7842
United States Holocaust Memorial Museum
www.ushmm.org<http://www.ushmm.org/>
NEVER AGAIN: WHAT YOU DO MATTERS
Support<http://www.ushmm.org/campaign/> the Campaign for the United States Holocaust Memorial Museum
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20140507/a54946eb/attachment.html>
More information about the Archivesspace_Users_Group
mailing list