<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Dear all,<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<br>
Hello, this is Corey Schmidt from the University of Georgia. I hope everyone is well and enjoying the slow warmup to Spring.<br>
<br>
I've been hitting some roadblocks trying to write documentation for API endpoints and I wanted to askfor your help. For the
<a href="https://archivesspace.github.io/archivesspace/api/?shell#find-resources-by-their-identifiers" title="https://archivesspace.github.io/archivesspace/api/?shell#find-resources-by-their-identifiers">
find_by_id resource endpoint</a>, I'm trying to find a resource with a four-part ID, but when I call the endpoint, it keeps giving me an error I can't pin down. Here's what I'm calling:
<div>
<pre style="background-color: rgb(43, 43, 43); color: rgb(169, 183, 198); font-family: "JetBrains Mono", monospace; font-size: 9.8pt;"><pre style="background-color: rgb(43, 43, 43); color: rgb(169, 183, 198); font-family: "JetBrains Mono", monospace; font-size: 9.8pt;"><span style="color: rgb(204, 120, 50);">from </span>asnake.client <span style="color: rgb(204, 120, 50);">import </span>ASnakeClient<br><span style="color: rgb(204, 120, 50);">import </span>asnake.logging <span style="color: rgb(204, 120, 50);">as </span>loggin</pre>client = ASnakeClient(<span style="color: rgb(170, 73, 38);">baseurl</span>=as_api<span style="color: rgb(204, 120, 50);">, </span><span style="color: rgb(170, 73, 38);">username</span>=as_un<span style="color: rgb(204, 120, 50);">, </span><span style="color: rgb(170, 73, 38);">password</span>=as_pw)<br>client.authorize()<span style="color: rgb(128, 128, 128);"><br></span><span style="color: rgb(128, 128, 128);"><br></span>find_res_id = client.get(<span style="color: rgb(106, 135, 89);">'repositories/2/find_by_id/resources'</span><span style="color: rgb(204, 120, 50);">, </span><span style="color: rgb(170, 73, 38);">params</span>={<span style="color: rgb(106, 135, 89);">'identifier[]'</span>: [<span style="color: rgb(106, 135, 89);">'test'</span><span style="color: rgb(204, 120, 50);">, </span><span style="color: rgb(106, 135, 89);">'1234'</span><span style="color: rgb(204, 120, 50);">, </span><span style="color: rgb(106, 135, 89);">'abcd'</span><span style="color: rgb(204, 120, 50);">, </span><span style="color: rgb(106, 135, 89);">'!@#$'</span>]})<br><span style="color: rgb(136, 136, 198);">print</span>(find_res_id.json()<span style="color: rgb(204, 120, 50);">, </span>find_res_id)</pre>
</div>
<div><br>
</div>
<div>Here's the error message:</div>
{'error': "Had some trouble parsing your request: unexpected token at 'test'"} <Response [400]><br>
<br>
It may be an issue with the requests package, but I'm not sure. I tested both ASnake and requests, and they gave the same error.<br>
<br>
Any help/advice would be appreciated, thanks!<br>
<br>
Corey<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div></div>
<div></div>
<div>
<p style="font:12px 'Georgia','Times','sans-serif'"><span style="font-weight:900">Corey Schmidt</span>
<br>
<span>Special Collections Libraries | <span style="font-style:italic">ArchivesSpace Project Manager</span></span></p>
<p style="font:12px 'Georgia','Times','sans-serif'"><span><span style="font-style:italic"><br>
</span></span></p>
<p style="font:12px 'Georgia','Times','sans-serif'"><span><a href="tel:7065428151">706-542-8151</a> |
<a href="mailto:Corey.Schmidt@uga.edu">Corey.Schmidt@uga.edu</a><br>
</span></p>
<p style="font:12px 'Georgia','Times','sans-serif'"><br>
<span></span></p>
<div><img alt="University of Georgia" width="160" src="https://brand.uga.edu/email-signature-builder/assets/images/uga-logo@2x.png"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>