<div dir="ltr">Thanks James, that did it <div><br></div><div>just for reference: </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">client.get('repositories/3/search?type[]=resource&page=1&aq={"query":{"field":"title","value":"' + q + '", "jsonmodel_type":"field_query","negated":false,"literal":true}}')</blockquote></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="verdana, sans-serif">Donald R. Mennerich, </font><span style="font-family:verdana,sans-serif">digital archivist</span><div><font face="verdana, sans-serif">New York University Libraries</font></div><div><font face="verdana, sans-serif"><a href="mailto:don.mennerich@nyu.edu" target="_blank">don.mennerich@nyu.edu</a> (212) 992-6264<br></font><div><font face="verdana, sans-serif"><br></font></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Nov 9, 2016 at 4:55 PM, James Bullen <span dir="ltr"><<a href="mailto:james@hudmol.com" target="_blank">james@hudmol.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br></div><div>Hi Don,</div><div><br></div><div>Try this:</div><div><span class="m_-8953509246699834224Apple-tab-span" style="white-space:pre-wrap">     </span><font face="Courier New">type[]=resource</font></div><div><br></div><div><br></div><div>Cheers,</div><div>James</div><div><br></div><div><br></div><br><div><blockquote type="cite"><div><div class="h5"><div>On Nov 10, 2016, at 5:44 AM, Valerie Addonizio <<a href="mailto:vaddoniz@jhu.edu" target="_blank">vaddoniz@jhu.edu</a>> wrote:</div><br class="m_-8953509246699834224Apple-interchange-newline"></div></div><div><div><div class="h5"><div class="m_-8953509246699834224WordSection1" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hmm, another suggestion from a colleague is to remove the brackets around resource:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">response = client.get('repositories/3/<wbr>search?page=1&aq={"query":{"<wbr>field":"title","value":"Jeremy Blake Papers", "jsonmodel_type":"field_query"<wbr>,"negated":false,"literal":<wbr>true, "type": "resource" }}')<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"><span class="m_-8953509246699834224Apple-converted-space"> </span><a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" style="color:purple;text-decoration:underline" target="_blank">archivesspace_users_<wbr>group-bounces@lyralists.<wbr>lyrasis.org</a><span class="m_-8953509246699834224Apple-converted-space"> </span>[<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" style="color:purple;text-decoration:underline" target="_blank">mailto:<wbr>archivesspace_users_group-<wbr>bounces@lyralists.lyrasis.org</a>]<span class="m_-8953509246699834224Apple-converted-space"><wbr> </span><b>On Behalf Of<span class="m_-8953509246699834224Apple-converted-space"> </span></b>Donald Mennerich<br><b>Sent:</b><span class="m_-8953509246699834224Apple-converted-space"> </span>Wednesday, November 09, 2016 12:05 PM<br><b>To:</b><span class="m_-8953509246699834224Apple-converted-space"> </span>Archivesspace Users Group<br><b>Subject:</b><span class="m_-8953509246699834224Apple-converted-space"> </span>Re: [Archivesspace_Users_Group] limiting API search query to specific record types<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Thanks,<u></u><u></u></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Thanks, I did try that. The resources endpoint is expecting an :id, and the api returns: <span style="font-size:8.5pt;font-family:menlo,serif">{"error"=>{"id"=>["<wbr>Wanted type Integer but got 'search'"]}}</span><u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br clear="all"><u></u><u></u></div><div><div><div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-family:Verdana,sans-serif">Don</span><u></u><u></u></div></div></div></div></div></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">On Wed, Nov 9, 2016 at 11:53 AM, Valerie Addonizio <<a href="mailto:vaddoniz@jhu.edu" style="color:purple;text-decoration:underline" target="_blank">vaddoniz@jhu.edu</a>> wrote:<u></u><u></u></div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">This is only a guess, but including the endpoint for Resource may do it, here, in your string:</span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:9.5pt">repositories/3/<span style="color:red">resources/</span></span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span><u></u><u></u></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"><span class="m_-8953509246699834224Apple-converted-space"> </span><a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" style="color:purple;text-decoration:underline" target="_blank">archivesspace_users_<wbr>group-bounces@lyralists.<wbr>lyrasis.org</a><span class="m_-8953509246699834224Apple-converted-space"> </span>[mailto:<a href="mailto:archivesspace_users_group-bounces@lyralists.lyrasis.org" style="color:purple;text-decoration:underline" target="_blank">archivessp<wbr>ace_users_group-bounces@<wbr>lyralists.lyrasis.org</a>]<span class="m_-8953509246699834224Apple-converted-space"> </span><b>On Behalf Of<span class="m_-8953509246699834224Apple-converted-space"> </span></b>Donald Mennerich<br><b>Sent:</b><span class="m_-8953509246699834224Apple-converted-space"> </span>Wednesday, November 09, 2016 11:43 AM<br><b>To:</b><span class="m_-8953509246699834224Apple-converted-space"> </span><a href="mailto:archivesspace_users_group@lyralists.lyrasis.org" style="color:purple;text-decoration:underline" target="_blank">archivesspace_users_group@<wbr>lyralists.lyrasis.org</a><br><b>Subject:</b><span class="m_-8953509246699834224Apple-converted-space"> </span>[Archivesspace_Users_<wbr>Group] limiting API search query to specific record types</span><u></u><u></u></div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">AUG:<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">I am trying to get resource records from the ASpace API, I'm currently using the advanced query example that Chris had posted in 2015.<u></u><u></u></div><div><table class="m_-8953509246699834224MsoNormalTable" border="0" cellpadding="0"><tbody><tr><td style="padding:4.5pt 0in"><table class="m_-8953509246699834224MsoNormalTable" border="0" cellpadding="0"><tbody><tr><td style="padding:4.5pt 0in"><blockquote style="border-style:none none none solid;border-left-color:rgb(204,204,204);border-left-width:1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:9.5pt">response = client.get('repositories/3/<wbr>search?page=1&aq={"query":{"<wbr>field":"title","value":"Jeremy Blake Papers", "jsonmodel_type":"field_query"<wbr>,"negated":false,"literal":<wbr>true}}')</span><u></u><u></u></div></blockquote></td></tr></tbody></table></td></tr></tbody></table></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">While this returns the wanted resource record, the api also returns an accession record and a collection control management. So my question: how can I filter to just resource records? I see in the json for any record has a field to  "type"=>["resource"], and there's documentation in the API about using this field in an advanced query:<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div></div><blockquote style="border-style:none none none solid;border-left-color:rgb(204,204,204);border-left-width:1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:10pt;font-family:Helvetica,sans-serif;color:rgb(51,51,51);background-color:white;background-position:initial initial;background-repeat:initial initial">[String] type – The record type to search (defaults to all types if not specified)</span><u></u><u></u></div></blockquote><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">I've tried adding a "type" parameter to a query in numerous ways, such as:<u></u><u></u></div></div><table class="m_-8953509246699834224MsoNormalTable" border="0" cellpadding="0"><tbody><tr><td style="padding:4.5pt 0in"><table class="m_-8953509246699834224MsoNormalTable" border="0" cellpadding="0"><tbody><tr><td style="padding:4.5pt 0in"><blockquote style="border-style:none none none solid;border-left-color:rgb(204,204,204);border-left-width:1pt;padding:0in 0in 0in 6pt;margin:5pt 0in 5pt 4.8pt"><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-size:9.5pt">response = client.get('repositories/3/<wbr>search?page=1&aq={"query":{"<wbr>field":"title","value":"Jeremy Blake Papers", "jsonmodel_type":"field_query"<wbr>,"negated":false,"literal":<wbr>true,<span class="m_-8953509246699834224Apple-converted-space"> </span><b><span style="color:red">"type": ["resource"]<span class="m_-8953509246699834224Apple-converted-space"> </span></span></b>}}')</span><u></u><u></u></div></blockquote></td></tr></tbody></table></td></tr></tbody></table><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Can anyone provide some guidance on how to limit results from the search API to specific record types?<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Thanks.<u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div></div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif">Don<u></u><u></u></div></div><div><div><div><div><div><div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"> <u></u><u></u></div></div></div></div></div></div></div></div></div></div></div></div></div><p class="MsoNormal" style="margin:0in 0in 12pt;font-size:12pt;font-family:'Times New Roman',serif"><br>______________________________<wbr>_________________<br>Archivesspace_Users_Group mailing list<br><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" style="color:purple;text-decoration:underline" target="_blank">Archivesspace_Users_Group@<wbr>lyralists.lyrasis.org</a><br><a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" style="color:purple;text-decoration:underline" target="_blank">http://lyralists.lyrasis.org/<wbr>mailman/listinfo/<wbr>archivesspace_users_group</a><u></u><u></u></p></div><div style="margin:0in 0in 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><u></u> <u></u></div></div></div></div></div></div><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">!DSPAM:<wbr>58236ea1294121893667704!<span class="m_-8953509246699834224Apple-converted-space"> </span></span><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">_____<wbr>______________________________<wbr>____________</span><span class=""><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Archivesspace_Users_Group mailing list</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" style="color:purple;text-decoration:underline;font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">Archivesspace_Users_Group@<wbr>lyralists.lyrasis.org</a><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" style="color:purple;text-decoration:underline;font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lyralists.lyrasis.org/<wbr>mailman/listinfo/<wbr>archivesspace_users_group</a><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></span><span style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">!DSPAM:<wbr>58236ea1294121893667704!</span><br style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"></div></blockquote></div><br></div><br>______________________________<wbr>_________________<br>
Archivesspace_Users_Group mailing list<br>
<a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org">Archivesspace_Users_Group@<wbr>lyralists.lyrasis.org</a><br>
<a href="http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group" rel="noreferrer" target="_blank">http://lyralists.lyrasis.org/<wbr>mailman/listinfo/<wbr>archivesspace_users_group</a><br>
<br></blockquote></div><br></div>