[Archivesspace_Users_Group] ASpace API - Query by Location Barcode?

Andrew Morrison andrew.morrison at bodleian.ox.ac.uk
Tue Dec 14 08:03:32 EST 2021


The /search/repositories endpoint searches for repositories, so 
filtering that to only return locations will always return no hits. To 
search globally, say for a location with a barcode of 123456789, you 
could use something like this:


/search?q=123456789&page=1&page_size=100&type[]=location


All search endpoints return Solr documents. If you want guaranteed 
up-to-date location records, sourced from the MySQL database, extract 
the "uri" from the matched Solr docs, and send GET requests for each.


Andrew.



On 13/12/2021 23:04, Joshua D. Shaw wrote:
> I don't see a specific endpoint for location by barcode, but I think 
> you could hit the generic search endpoint with the following. It's 
> going to show all locations that match that particular string, so not 
> guaranteed that you'll only get one result.
> |/search/repositories?|filter_term[]={"primary_type"%3A"location"}&q={MY_BARCODE}&sort=score+desc
> This is across all repos, so you could also limit to a specific repo 
> by|/repositories/{REPO_ID}/search?|filter_term[]={"primary_type"%3A"location"}&q={MY_BARCODE}&sort=score+desc
> Joshua
> ------------------------------------------------------------------------
> *From:* archivesspace_users_group-bounces at lyralists.lyrasis.org 
> <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of 
> Matthew Adair <mladair at umich.edu>
> *Sent:* Monday, December 13, 2021 3:27 PM
> *To:* Archivesspace Users Group 
> <archivesspace_users_group at lyralists.lyrasis.org>
> *Subject:* [Archivesspace_Users_Group] ASpace API - Query by Location 
> Barcode?
> Maybe I just haven't figured it out yet, but is there a way in the API 
> to return information about a Location by searching by it's barcode?
>
> Thanks,
> - Matt
>
> ----*
> Matthew Adair*
> Lead Archivist for Digital Imaging and Infrastructure
> /[Due to working remotely, email is the best method to reach me.]
> /
> /
> /
>
> Bentley Historical Library
> 1150 Beal Avenue
> Ann Arbor, Michigan 48109-2113
> 734-647-3537
> http://bentley.umich.edu
> <https://nam12.safelinks.protection.outlook.com/?url=http%3A%2F%2Fbentley.umich.edu%2F&data=04%7C01%7Cjoshua.d.shaw%40dartmouth.edu%7C0d909a4cafd749bc1ec008d9be770004%7C995b093648d640e5a31ebf689ec9446f%7C0%7C0%7C637750241320782135%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=HsbWnZDSfbVbZHsQoicCre7kZm0QtUipumpoG026T2s%3D&reserved=0>@UmichBentley 
>
>
> /The Bentley Historical Library acknowledges that coerced cessions of 
> land by the Anishnaabeg and Wyandot made the University of Michigan 
> possible, and we seek to reaffirm the ancestral and contemporary ties 
> of these peoples to the lands where the University now stands./
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20211214/f3274eda/attachment.html>


More information about the Archivesspace_Users_Group mailing list