<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
  </head>
  <body>
    <p>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:</p>
    <p><br>
    </p>
    <p>/search?q=123456789&page=1&page_size=100&type[]=location</p>
    <p><br>
    </p>
    <p>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.</p>
    <p><br>
    </p>
    <p>Andrew.</p>
    <p><br>
    </p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 13/12/2021 23:04, Joshua D. Shaw
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:BL0PR03MB429224D234BE212C90678037AB749@BL0PR03MB4292.namprd03.prod.outlook.com">
      
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        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.<br>
      </div>
      <div style="font-family: Calibri, Arial, Helvetica, sans-serif;
        font-size: 12pt; color: rgb(0, 0, 0);">
        <pre class="highlight shell" style="display:block"><code><span class="s2">/search/repositories?</span></code>filter_term[]={"primary_type"%3A"location"}&q={MY_BARCODE}&sort=score+desc
</pre>
      </div>
      <div>
        <div style="font-family:Calibri,Arial,Helvetica,sans-serif;
          font-size:12pt; color:rgb(0,0,0)">
          <pre style="display:block"><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">This is across all repos, so you could also limit to a specific repo by</span><code><span class="s2">

/repositories/{REPO_ID}/search?</span></code>filter_term[]={"primary_type"%3A"location"}&q={MY_BARCODE}&sort=score+desc</pre>
          Joshua<br>
        </div>
        <hr tabindex="-1" style="display:inline-block; width:98%">
        <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b>
            <a class="moz-txt-link-abbreviated" href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org">archivesspace_users_group-bounces@lyralists.lyrasis.org</a>
            <a class="moz-txt-link-rfc2396E" href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org"><archivesspace_users_group-bounces@lyralists.lyrasis.org></a>
            on behalf of Matthew Adair <a class="moz-txt-link-rfc2396E" href="mailto:mladair@umich.edu"><mladair@umich.edu></a><br>
            <b>Sent:</b> Monday, December 13, 2021 3:27 PM<br>
            <b>To:</b> Archivesspace Users Group
            <a class="moz-txt-link-rfc2396E" href="mailto:archivesspace_users_group@lyralists.lyrasis.org"><archivesspace_users_group@lyralists.lyrasis.org></a><br>
            <b>Subject:</b> [Archivesspace_Users_Group] ASpace API -
            Query by Location Barcode?</font>
          <div> </div>
        </div>
        <div>
          <div dir="ltr">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?
            <div><br>
              <div>Thanks,</div>
              <div>- Matt<br>
              </div>
              <div>
                <div>
                  <div dir="ltr" class="x_gmail_signature">
                    <div dir="ltr">
                      <div>
                        <div dir="ltr">
                          <div>
                            <div dir="ltr">
                              <div>
                                <div dir="ltr">
                                  <div dir="ltr">
                                    <div dir="ltr">
                                      <div dir="ltr">
                                        <div dir="ltr">
                                          <div dir="ltr">
                                            <div><br>
                                              ----<b><br>
                                                Matthew Adair</b><br>
                                            </div>
                                            <div>Lead Archivist for
                                              Digital Imaging and
                                              Infrastructure</div>
                                            <div><i><font color="#0000ff">[Due
                                                  to working remotely,
                                                  email is the best
                                                  method to reach me.]<br>
                                                </font></i></div>
                                            <div><i><br>
                                              </i></div>
                                            <div dir="ltr"><img src="https://docs.google.com/uc?export=download&id=1OAXggdOikJu9Gk1yHxKSXoZJ99A4RAqz&revid=0Bw_nuz0O5gALekV3cHNpMWkrd0dYSWQ1Vyt4Mzc2cU43YmpZPQ" moz-do-not-send="true" width="200" height="15"><br>
                                            </div>
                                            Bentley Historical Library<br>
                                            1150 Beal Avenue<br>
                                            Ann Arbor, Michigan
                                            48109-2113<br>
                                            734-647-3537<br>
                                            <a href="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" originalsrc="http://bentley.umich.edu/" shash="XeiVHWuIiI6nd9mwLQxZh3HDK3FHEdnQmqzOnSi369Anc++RQYSxNXn4iEmHNxp+3ha3b53fC8TnbUl8s+N5IbHwWHY+u8FSVeVggEu1cD+ESdVS0Qmo5QY6a9hBgaSzHfBpNQsZGYC7O8Ck0kYrW+paJYfxMny5mdMg1+4v6zQ=" target="_blank" moz-do-not-send="true">http://bentley.umich.edu<br>
                                            </a>@UmichBentley </div>
                                          <div dir="ltr"><br>
                                          </div>
                                          <div dir="ltr"><font color="#666666"><i>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.</i></font><br>
                                          </div>
                                        </div>
                                      </div>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Archivesspace_Users_Group mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@lyralists.lyrasis.org</a>
<a class="moz-txt-link-freetext" href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group</a>
</pre>
    </blockquote>
  </body>
</html>