[Archivesspace_Users_Group] API queries for library discovery interface question

Gaddam, Sruthin gaddamsr at lib.msu.edu
Thu Feb 15 10:59:30 EST 2018


Hi Lydia /Dao


Thank you for your actions and inputs


We already implemented  the web scraping option, our current goal is to get away from it . Also I'm going to try and use the API in a different way  as suggested in this email. I will also check solr(which I have access ) to better understand how the results are given. I will let you know what I find.


Thanks

Sruthin

________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Tang, Lydia <ltang5 at lib.msu.edu>
Sent: Thursday, February 15, 2018 8:59:56 AM
To: Archivesspace Users Group
Subject: Re: [Archivesspace_Users_Group] API queries for library discovery interface question

Thank you, both, for this helpful feedback!  This is all Greek to me, but I’ve passed it along to my IT person.  We’ll try the POST request and also look more into the OAI-PMH harvesting!
Lydia

From: <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Seth Shaw <seth.shaw at unlv.edu>
Reply-To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Date: Wednesday, February 14, 2018 at 12:28 PM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: Re: [Archivesspace_Users_Group] API queries for library discovery interface question

If your discovery interface supports OAI-PMH harvesting you may want to consider that as an alternative to the API or webscraping. We plan on exploring using it with our new Primo discovery interface (once some other Primo bugs are fixed first).

On Wed, Feb 14, 2018 at 8:45 AM Tang, Lydia <ltang5 at lib.msu.edu<mailto:ltang5 at lib.msu.edu>> wrote:
Good morning, all!
I have a mystery…  My institution is trying to pull from the API to integrate the results in our search discovery interface of our catalog.  The mystery is that apparently, our API call seems to bring back bogus results whereas if we scrape from the HTML of the PUI, the search results are as expected.
Here is the API call

curl -H "X-ArchivesSpace-Session: c3a1ea6a48af5e9324a19bf1e79d284b921cbc97aed93b143d76b6b457f5b144 " -H "q:java"   "http://as.lib.msu.edu:8089//search?page=1&page_size=5<http://as.lib.msu.edu:8089/search?page=1&page_size=5><http://as.lib.msu.edu:8089/search?page=1&page_size=5>"

If you look closely I’m searching for java and I want the 1st page with 5 results


And here are the results.

{
"page_size": 5,
"first_page": 1,
"last_page": 37084,
"this_page": 1,
"offset_first": 1,
"offset_last": 5,
"total_hits": 185418,
"results": [{
"id": "/repositories/2/archival_objects/40489#pui",
"uri": "/repositories/2/archival_objects/40489",
"title": "ACCESS brochure [multiple copies]: Tennis anyone? The US Tennis Association supports South African apartheid sport. File tab heading deleted: '1998 Suntrust.'",
"primary_type": "archival_object",
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],
"suppressed": false,
"publish": true,
"system_generated": false,
"repository": "/repositories/2",
"level_enum_s": ["file", "collection", "Collection"],
"language_enum_s": ["eng"],
"era_enum_s": ["ce"],
"calendar_enum_s": ["gregorian"],
"date_type_enum_s": ["inclusive"],
"label_enum_s": ["creation"],
"instance_type_enum_s": ["mixed_materials"],
"type_2_enum_s": ["Folder"],
"type_enum_s": ["accessrestrict"],
"resource": "/repositories/2/resources/1635",
"ref_id": "466d81ff59913c97939fde12489219ff",
"created_by": "nicole",
"last_modified_by": "ireneb",
"user_mtime": "2016-07-01T18:11:16Z",
"system_mtime": "2017-09-11T13:08:32Z",
"create_time": "2015-11-11T15:12:39Z",
"notes": "16e50bf92d4374421f5f0be27fbb6c01 accessrestrict The collection is open for research. /repositories/2/resources/1635 Collection  accessrestrict The material is stored offsite in Remote Storage. Please contact Special Collections 3 working days in advance if you wish to use it. ad5860db9def8f2e6f9dabd4bd6a2286 /repositories/2/resources/1635 Collection",
"level": "file",
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],
"child_container_u_sstr": ["Folder 2"],
"ancestors": ["/repositories/2/resources/1635"],
"pui_parent_id": "/repositories/2/archival_objects/40489",
"_version_": 1578264853456355328,
"jsonmodel_type": "archival_object"
}, {
"id": "/repositories/2/archival_objects/40497#pui",
"uri": "/repositories/2/archival_objects/40497",
"title": "UN North American mtg.",
"primary_type": "archival_object",
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],
"suppressed": false,
"publish": true,
"system_generated": false,
"repository": "/repositories/2",
"level_enum_s": ["file", "Collection", "collection"],
"language_enum_s": ["eng"],
"era_enum_s": ["ce"],
"calendar_enum_s": ["gregorian"],
"date_type_enum_s": ["inclusive"],
"label_enum_s": ["creation"],
"certainty_enum_s": ["approximate"],
"instance_type_enum_s": ["mixed_materials"],
"type_2_enum_s": ["Folder"],
"type_enum_s": ["accessrestrict"],
"resource": "/repositories/2/resources/1635",
"ref_id": "8330d1cb75d1ab9905c2cd6ad2e58487",
"created_by": "nicole",
"last_modified_by": "ireneb",
"user_mtime": "2016-07-01T18:12:34Z",
"system_mtime": "2017-09-11T13:08:32Z",
"create_time": "2015-11-11T15:12:39Z",
"notes": "16e50bf92d4374421f5f0be27fbb6c01 accessrestrict The collection is open for research. /repositories/2/resources/1635 Collection  accessrestrict The material is stored offsite in Remote Storage. Please contact Special Collections 3 working days in advance if you wish to use it. ad5860db9def8f2e6f9dabd4bd6a2286 /repositories/2/resources/1635 Collection",
"level": "file",
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],
"child_container_u_sstr": ["Folder 6"],
"ancestors": ["/repositories/2/resources/1635"],
"pui_parent_id": "/repositories/2/archival_objects/40497",
"_version_": 1578264853461598208,
"jsonmodel_type": "archival_object"
}, {
"id": "/repositories/2/archival_objects/40499#pui",
"uri": "/repositories/2/archival_objects/40499",
"title": "Apartheid in Sports Information Center: letters by R. Lapchick (ACESS) to various African ambassadors and OAU re: sports sanctions; and a release on a proposed Apartheid in Sports Information Center",
"primary_type": "archival_object",
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],
"suppressed": false,
"publish": true,
"system_generated": false,
"repository": "/repositories/2",
"level_enum_s": ["file", "collection", "Collection"],
"language_enum_s": ["eng"],
"era_enum_s": ["ce"],
"calendar_enum_s": ["gregorian"],
"date_type_enum_s": ["inclusive"],
"label_enum_s": ["creation"],
"instance_type_enum_s": ["mixed_materials"],
"type_2_enum_s": ["Folder"],
"type_enum_s": ["accessrestrict"],
"resource": "/repositories/2/resources/1635",
"ref_id": "5222b42987709cddc579da05e00ea265",
"created_by": "nicole",
"last_modified_by": "ireneb",
"user_mtime": "2016-07-01T18:12:51Z",
"system_mtime": "2017-09-11T13:08:32Z",
"create_time": "2015-11-11T15:12:39Z",
"notes": "16e50bf92d4374421f5f0be27fbb6c01 accessrestrict The collection is open for research. /repositories/2/resources/1635 Collection  accessrestrict The material is stored offsite in Remote Storage. Please contact Special Collections 3 working days in advance if you wish to use it. ad5860db9def8f2e6f9dabd4bd6a2286 /repositories/2/resources/1635 Collection",
"level": "file",
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],
"child_container_u_sstr": ["Folder 7"],
"ancestors": ["/repositories/2/resources/1635"],
"pui_parent_id": "/repositories/2/archival_objects/40499",
"_version_": 1578264853462646784,
"jsonmodel_type": "archival_object"
}, {
"id": "/repositories/2/archival_objects/40507#pui",
"uri": "/repositories/2/archival_objects/40507",
"title": "Cables and Letters Access",
"primary_type": "archival_object",
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],
"suppressed": false,
"publish": true,
"system_generated": false,
"repository": "/repositories/2",
"level_enum_s": ["file", "Collection", "collection"],
"language_enum_s": ["eng"],
"era_enum_s": ["ce"],
"calendar_enum_s": ["gregorian"],
"date_type_enum_s": ["inclusive"],
"label_enum_s": ["creation"],
"certainty_enum_s": ["approximate"],
"instance_type_enum_s": ["mixed_materials"],
"type_2_enum_s": ["Folder"],
"type_enum_s": ["accessrestrict"],
"resource": "/repositories/2/resources/1635",
"ref_id": "01ca389a63b99eb2cf7d10bea1895d94",
"created_by": "nicole",
"last_modified_by": "ireneb",
"user_mtime": "2016-07-01T18:28:43Z",
"system_mtime": "2017-09-11T13:08:32Z",
"create_time": "2015-11-11T15:12:39Z",
"notes": "16e50bf92d4374421f5f0be27fbb6c01 accessrestrict The collection is open for research. /repositories/2/resources/1635 Collection  accessrestrict The material is stored offsite in Remote Storage. Please contact Special Collections 3 working days in advance if you wish to use it. ad5860db9def8f2e6f9dabd4bd6a2286 /repositories/2/resources/1635 Collection",
"level": "file",
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],
"child_container_u_sstr": ["Folder 10"],
"ancestors": ["/repositories/2/resources/1635"],
"pui_parent_id": "/repositories/2/archival_objects/40507",
"_version_": 1578264853465792512,
"jsonmodel_type": "archival_object"
}, {
"id": "/repositories/2/archival_objects/40509#pui",
"uri": "/repositories/2/archival_objects/40509",
"title": "Churches and SA: single item: Leon Howell, \"South Africa and the Attack on the Churches\" Washington Notes on Africa",
"primary_type": "archival_object",
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],
"suppressed": false,
"publish": true,
"system_generated": false,
"repository": "/repositories/2",
"level_enum_s": ["file", "collection", "Collection"],
"language_enum_s": ["eng"],
"era_enum_s": ["ce"],
"calendar_enum_s": ["gregorian"],
"date_type_enum_s": ["inclusive"],
"label_enum_s": ["creation"],
"instance_type_enum_s": ["mixed_materials"],
"type_2_enum_s": ["Folder"],
"type_enum_s": ["accessrestrict"],
"resource": "/repositories/2/resources/1635",
"ref_id": "b6104465dc2884a56819f6173dbd258b",
"created_by": "nicole",
"last_modified_by": "ireneb",
"user_mtime": "2016-07-01T18:29:22Z",
"system_mtime": "2017-09-11T13:08:32Z",
"create_time": "2015-11-11T15:12:39Z",
"notes": "16e50bf92d4374421f5f0be27fbb6c01 accessrestrict The collection is open for research. /repositories/2/resources/1635 Collection  accessrestrict The material is stored offsite in Remote Storage. Please contact Special Collections 3 working days in advance if you wish to use it. ad5860db9def8f2e6f9dabd4bd6a2286 /repositories/2/resources/1635 Collection",
"level": "file",
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],
"child_container_u_sstr": ["Folder 11"],
"ancestors": ["/repositories/2/resources/1635"],
"pui_parent_id": "/repositories/2/archival_objects/40509",
"_version_": 1578264853467889664,
"jsonmodel_type": "archival_object"
}],
"facets": {
"facet_queries": {},
"facet_fields": {},
"facet_dates": {},
"facet_ranges": {},
"facet_intervals": {}
}
}

Which are different from the results at http://as.lib.msu.edu/search?utf8=%E2%9C%93&op%5B%5D=&q%5B%5D=java&limit=&field%5B%5D=&from_year%5B%5D=&to_year%5B%5D=&commit=Search

It would be ideal to pull from the API for this function, since it sounds like every time we upgrade, my IT person has to update the HTML scrape for any potential changes.  Has anyone else experienced this issue?  We’re currently on version 2.1.1.
Thanks!

Lydia
--
Dr. Lydia Tang, CA, DMA, MLIS
Special Collections Archivist-Librarian
Philosophy, Aesthetics, and Ethics Bibliographer
Michigan State University Libraries
366 W. Circle Drive<https://maps.google.com/?q=366+W.+Circle+Drive&entry=gmail&source=g> (DB 6)
East Lansing, MI 48824-1048
Email: ltang5 at msu.edu<mailto:ltang5 at msu.edu>
Phone: 517-884-8984
_______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group at lyralists.lyrasis.org<mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
_______________________________________________
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