<div><div dir="auto">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).</div><br><div class="gmail_quote"><div>On Wed, Feb 14, 2018 at 8:45 AM Tang, Lydia <<a href="mailto:ltang5@lib.msu.edu">ltang5@lib.msu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Good morning, all!<br>
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.<br>
Here is the API call<br>
<br>
curl -H "X-ArchivesSpace-Session: c3a1ea6a48af5e9324a19bf1e79d284b921cbc97aed93b143d76b6b457f5b144 " -H "q:java"   "<a href="http://as.lib.msu.edu:8089//search?page=1&page_size=5" rel="noreferrer" target="_blank">http://as.lib.msu.edu:8089//search?page=1&page_size=5</a><<a href="http://as.lib.msu.edu:8089/search?page=1&page_size=5" rel="noreferrer" target="_blank">http://as.lib.msu.edu:8089/search?page=1&page_size=5</a>>"<br>
<br>
If you look closely I’m searching for java and I want the 1st page with 5 results<br>
<br>
<br>
And here are the results.<br>
<br>
{<br>
"page_size": 5,<br>
"first_page": 1,<br>
"last_page": 37084,<br>
"this_page": 1,<br>
"offset_first": 1,<br>
"offset_last": 5,<br>
"total_hits": 185418,<br>
"results": [{<br>
"id": "/repositories/2/archival_objects/40489#pui",<br>
"uri": "/repositories/2/archival_objects/40489",<br>
"title": "ACCESS brochure [multiple copies]: Tennis anyone? The US Tennis Association supports South African apartheid sport. File tab heading deleted: '1998 Suntrust.'",<br>
"primary_type": "archival_object",<br>
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],<br>
"suppressed": false,<br>
"publish": true,<br>
"system_generated": false,<br>
"repository": "/repositories/2",<br>
"level_enum_s": ["file", "collection", "Collection"],<br>
"language_enum_s": ["eng"],<br>
"era_enum_s": ["ce"],<br>
"calendar_enum_s": ["gregorian"],<br>
"date_type_enum_s": ["inclusive"],<br>
"label_enum_s": ["creation"],<br>
"instance_type_enum_s": ["mixed_materials"],<br>
"type_2_enum_s": ["Folder"],<br>
"type_enum_s": ["accessrestrict"],<br>
"resource": "/repositories/2/resources/1635",<br>
"ref_id": "466d81ff59913c97939fde12489219ff",<br>
"created_by": "nicole",<br>
"last_modified_by": "ireneb",<br>
"user_mtime": "2016-07-01T18:11:16Z",<br>
"system_mtime": "2017-09-11T13:08:32Z",<br>
"create_time": "2015-11-11T15:12:39Z",<br>
"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",<br>
"level": "file",<br>
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],<br>
"child_container_u_sstr": ["Folder 2"],<br>
"ancestors": ["/repositories/2/resources/1635"],<br>
"pui_parent_id": "/repositories/2/archival_objects/40489",<br>
"_version_": 1578264853456355328,<br>
"jsonmodel_type": "archival_object"<br>
}, {<br>
"id": "/repositories/2/archival_objects/40497#pui",<br>
"uri": "/repositories/2/archival_objects/40497",<br>
"title": "UN North American mtg.",<br>
"primary_type": "archival_object",<br>
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],<br>
"suppressed": false,<br>
"publish": true,<br>
"system_generated": false,<br>
"repository": "/repositories/2",<br>
"level_enum_s": ["file", "Collection", "collection"],<br>
"language_enum_s": ["eng"],<br>
"era_enum_s": ["ce"],<br>
"calendar_enum_s": ["gregorian"],<br>
"date_type_enum_s": ["inclusive"],<br>
"label_enum_s": ["creation"],<br>
"certainty_enum_s": ["approximate"],<br>
"instance_type_enum_s": ["mixed_materials"],<br>
"type_2_enum_s": ["Folder"],<br>
"type_enum_s": ["accessrestrict"],<br>
"resource": "/repositories/2/resources/1635",<br>
"ref_id": "8330d1cb75d1ab9905c2cd6ad2e58487",<br>
"created_by": "nicole",<br>
"last_modified_by": "ireneb",<br>
"user_mtime": "2016-07-01T18:12:34Z",<br>
"system_mtime": "2017-09-11T13:08:32Z",<br>
"create_time": "2015-11-11T15:12:39Z",<br>
"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",<br>
"level": "file",<br>
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],<br>
"child_container_u_sstr": ["Folder 6"],<br>
"ancestors": ["/repositories/2/resources/1635"],<br>
"pui_parent_id": "/repositories/2/archival_objects/40497",<br>
"_version_": 1578264853461598208,<br>
"jsonmodel_type": "archival_object"<br>
}, {<br>
"id": "/repositories/2/archival_objects/40499#pui",<br>
"uri": "/repositories/2/archival_objects/40499",<br>
"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",<br>
"primary_type": "archival_object",<br>
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],<br>
"suppressed": false,<br>
"publish": true,<br>
"system_generated": false,<br>
"repository": "/repositories/2",<br>
"level_enum_s": ["file", "collection", "Collection"],<br>
"language_enum_s": ["eng"],<br>
"era_enum_s": ["ce"],<br>
"calendar_enum_s": ["gregorian"],<br>
"date_type_enum_s": ["inclusive"],<br>
"label_enum_s": ["creation"],<br>
"instance_type_enum_s": ["mixed_materials"],<br>
"type_2_enum_s": ["Folder"],<br>
"type_enum_s": ["accessrestrict"],<br>
"resource": "/repositories/2/resources/1635",<br>
"ref_id": "5222b42987709cddc579da05e00ea265",<br>
"created_by": "nicole",<br>
"last_modified_by": "ireneb",<br>
"user_mtime": "2016-07-01T18:12:51Z",<br>
"system_mtime": "2017-09-11T13:08:32Z",<br>
"create_time": "2015-11-11T15:12:39Z",<br>
"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",<br>
"level": "file",<br>
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],<br>
"child_container_u_sstr": ["Folder 7"],<br>
"ancestors": ["/repositories/2/resources/1635"],<br>
"pui_parent_id": "/repositories/2/archival_objects/40499",<br>
"_version_": 1578264853462646784,<br>
"jsonmodel_type": "archival_object"<br>
}, {<br>
"id": "/repositories/2/archival_objects/40507#pui",<br>
"uri": "/repositories/2/archival_objects/40507",<br>
"title": "Cables and Letters Access",<br>
"primary_type": "archival_object",<br>
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],<br>
"suppressed": false,<br>
"publish": true,<br>
"system_generated": false,<br>
"repository": "/repositories/2",<br>
"level_enum_s": ["file", "Collection", "collection"],<br>
"language_enum_s": ["eng"],<br>
"era_enum_s": ["ce"],<br>
"calendar_enum_s": ["gregorian"],<br>
"date_type_enum_s": ["inclusive"],<br>
"label_enum_s": ["creation"],<br>
"certainty_enum_s": ["approximate"],<br>
"instance_type_enum_s": ["mixed_materials"],<br>
"type_2_enum_s": ["Folder"],<br>
"type_enum_s": ["accessrestrict"],<br>
"resource": "/repositories/2/resources/1635",<br>
"ref_id": "01ca389a63b99eb2cf7d10bea1895d94",<br>
"created_by": "nicole",<br>
"last_modified_by": "ireneb",<br>
"user_mtime": "2016-07-01T18:28:43Z",<br>
"system_mtime": "2017-09-11T13:08:32Z",<br>
"create_time": "2015-11-11T15:12:39Z",<br>
"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",<br>
"level": "file",<br>
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],<br>
"child_container_u_sstr": ["Folder 10"],<br>
"ancestors": ["/repositories/2/resources/1635"],<br>
"pui_parent_id": "/repositories/2/archival_objects/40507",<br>
"_version_": 1578264853465792512,<br>
"jsonmodel_type": "archival_object"<br>
}, {<br>
"id": "/repositories/2/archival_objects/40509#pui",<br>
"uri": "/repositories/2/archival_objects/40509",<br>
"title": "Churches and SA: single item: Leon Howell, \"South Africa and the Attack on the Churches\" Washington Notes on Africa",<br>
"primary_type": "archival_object",<br>
"types": ["archival_object", "pui", "pui_archival_object", "pui_record", "pui_only"],<br>
"suppressed": false,<br>
"publish": true,<br>
"system_generated": false,<br>
"repository": "/repositories/2",<br>
"level_enum_s": ["file", "collection", "Collection"],<br>
"language_enum_s": ["eng"],<br>
"era_enum_s": ["ce"],<br>
"calendar_enum_s": ["gregorian"],<br>
"date_type_enum_s": ["inclusive"],<br>
"label_enum_s": ["creation"],<br>
"instance_type_enum_s": ["mixed_materials"],<br>
"type_2_enum_s": ["Folder"],<br>
"type_enum_s": ["accessrestrict"],<br>
"resource": "/repositories/2/resources/1635",<br>
"ref_id": "b6104465dc2884a56819f6173dbd258b",<br>
"created_by": "nicole",<br>
"last_modified_by": "ireneb",<br>
"user_mtime": "2016-07-01T18:29:22Z",<br>
"system_mtime": "2017-09-11T13:08:32Z",<br>
"create_time": "2015-11-11T15:12:39Z",<br>
"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",<br>
"level": "file",<br>
"top_container_uri_u_sstr": ["/repositories/2/top_containers/1305"],<br>
"child_container_u_sstr": ["Folder 11"],<br>
"ancestors": ["/repositories/2/resources/1635"],<br>
"pui_parent_id": "/repositories/2/archival_objects/40509",<br>
"_version_": 1578264853467889664,<br>
"jsonmodel_type": "archival_object"<br>
}],<br>
"facets": {<br>
"facet_queries": {},<br>
"facet_fields": {},<br>
"facet_dates": {},<br>
"facet_ranges": {},<br>
"facet_intervals": {}<br>
}<br>
}<br>
<br>
Which are different from the results at <a href="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" rel="noreferrer" target="_blank">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</a><br>
<br>
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.<br>
Thanks!<br>
<br>
Lydia<br>
--<br>
Dr. Lydia Tang, CA, DMA, MLIS<br>
Special Collections Archivist-Librarian<br>
Philosophy, Aesthetics, and Ethics Bibliographer<br>
Michigan State University Libraries<br>
<a href="https://maps.google.com/?q=366+W.+Circle+Drive&entry=gmail&source=g">366 W. Circle Drive</a> (DB 6)<br>
East Lansing, MI 48824-1048<br>
Email: <a href="mailto:ltang5@msu.edu" target="_blank">ltang5@msu.edu</a><br>
Phone: 517-884-8984<br>
_______________________________________________<br>
Archivesspace_Users_Group mailing list<br>
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" target="_blank">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br>
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" rel="noreferrer" target="_blank">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a><br>
</blockquote></div></div>