Re: [Archivesspace_Users_Group] API queries for library discovery interface question

2018-02-15 Thread Gaddam, Sruthin
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-boun...@lyralists.lyrasis.org 
 on behalf of Tang, 
Lydia 
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:  on behalf of 
Seth Shaw 
Reply-To: Archivesspace Users Group 

Date: Wednesday, February 14, 2018 at 12:28 PM
To: Archivesspace Users Group 
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 
mailto:lta...@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&qu

Re: [Archivesspace_Users_Group] API queries for library discovery interface question

2018-02-15 Thread Tang, Lydia
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:  on behalf of 
Seth Shaw 
Reply-To: Archivesspace Users Group 

Date: Wednesday, February 14, 2018 at 12:28 PM
To: Archivesspace Users Group 
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 
mailto:lta...@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_

Re: [Archivesspace_Users_Group] API queries for library discovery interface question

2018-02-14 Thread Seth Shaw
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  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>"
>
> 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

Re: [Archivesspace_Users_Group] API queries for library discovery interface question

2018-02-14 Thread Majewski, Steven Dennis (sdm7g)

It looks like your example got a little mangled along the way: I assume what’s 
between the “<…>” doesn’t belong. 
But the ‘-H’ switch sends “q:java” as a HTTP header, not as a search param, so 
with a null query string, you are asking for everything.  

Try maybe: "http://as.lib.msu.edu:8089/search?page=1&page_size=5&q=java 
”

or if you want to send it as a POST instead of a GET request, use  -F or —form 
switch. 

Also, when debugging search problems, it’s sometimes handy to go directly to 
the Solr console at port 8090, if you’re using the default Solr settings in 
ArchivesSpace. 


— Steve.



> On Feb 14, 2018, at 11:45 AM, Tang, Lydia  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
>  
> "
> 
> If you look closely I’m searching for java and I want the 1st page with 5 
> results
> 



smime.p7s
Description: S/MIME cryptographic signature
___
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group@lyralists.lyrasis.org
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group


[Archivesspace_Users_Group] API queries for library discovery interface question

2018-02-14 Thread Tang, Lydia
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"

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_materia