<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
@font-face
        {font-family:"Century Gothic";
        panose-1:2 11 5 2 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-style-priority:99;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.contentpasted2
        {mso-style-name:contentpasted2;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:black;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black">Hey Alan,<br>
<br>
Big caveat first: we don’t use ARKs where I work, so I’m flying a little blind here. I enabled ARKs on our testing space just to see if I could replicate your request. Here’s what I tried and it returned the correct archival object:<br>
<br>
curl -H "X-ArchivesSpace-Session: $SESSION" "https://our_api_url/repositories/2/find_by_id/archival_objects?ark[]=www.testarkurl.com/ark:/YLTAD111/51/37;resolve[]=archival_objects"<br>
<br>
I added an external ARK URL to the archival object and put www.testarkurl.com/ark:/YLTAD111/51/37 in that field. Are you using something like this or trying to access internal ARKs? If it’s internal, I don’t have a way to test that, I’m afraid. Though it seems
 like the following requests are constructed properly:<br>
<br>
http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id[]=YLTAD111/51/37<br>
http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ref_id[]=15a419a9464353be174f77bdc8f38874   (our ref_ids look something like this usually: “ref36_286”, that looks like the container_id found in an EAD export)<br>
<br>
If you’re still getting a 404 error, I might also try using the “--url-encode” parameter to see if that helps. Dave Mayo at Harvard pointed me in this direction which works great for the find_by_id endpoint for resources. Using that would look something like:<br>
<br>
curl -H "X-ArchivesSpace-Session: $SESSION" -G http://ourhost.com:8089/repositories/5/find_by_id/archival_objects --data-urlencode 'component_id[]=YLTAD111/51/37'<br>
<br>
If you do find a solution, would you mind sharing it with the listserv or me? I wrote the API cURL and Python examples for that endpoint and I couldn’t find anyone using ARKs to build an example from. Adding that would be the last piece of the puzzle for that
 documentation.<br>
<br>
Hope this helps,<br>
<br>
Corey<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><b><span style="font-size:9.0pt;font-family:"Georgia",serif;color:black">Corey Schmidt</span></b><span style="font-size:9.0pt;font-family:"Georgia",serif;color:black">
<br>
Special Collections Libraries | <i>Project Management Librarian/Archivist</i> <o:p>
</o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><a href="mailto:Corey.Schmidt@uga.edu"><span style="font-size:9.0pt;font-family:"Georgia",serif">Corey.Schmidt@uga.edu</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> archivesspace_users_group-bounces@lyralists.lyrasis.org <archivesspace_users_group-bounces@lyralists.lyrasis.org>
<b>On Behalf Of </b>Alan Manifold<br>
<b>Sent:</b> Monday, December 12, 2022 10:50 PM<br>
<b>To:</b> ArchivesSpace Users Group <archivesspace_users_group@lyralists.lyrasis.org><br>
<b>Subject:</b> [Archivesspace_Users_Group] Find by ID API call<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="color:#BA0C2F">[EXTERNAL SENDER - PROCEED CAUTIOUSLY]</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black">Hi ArchivesSpace folks,<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black">I've been trying to get the find_by_id API call to work and haven't had any luck. What I really want is to be able to find archival objects by ARK, but
 I tried the other types of IDs to see if they would work and tell me something useful. But I can't get any of them to work. We're on version 3.2.0. I have a program that establishes a connection and gets a session ID, then sends off the API call. When the
 same program sends this search API, it works:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/search?q=component_id:%22YLTAD111/51/37"><span style="font-family:"Calibri",sans-serif;background:white">http://ourhost.com:8089/search?q=component_id:"YLTAD111/51/37</span></a><span class="contentpasted2"><span style="font-family:"Calibri",sans-serif;color:black;background:white">"
 OR component_id:"YLTAD111/51/38" OR component_id:"YLTAD111/51/39"&page=1</span></span><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
</blockquote>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black"><br>
Here's what I have tried:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark=https://ourhost.com/ark:/9999/119460"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark=https://ourhost.com/ark:/9999/119460</span></a><span style="font-family:"Calibri",sans-serif;color:black">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark=ark:/9999/119460"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark=ark:/9999/119460</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark=119460"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark=119460</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark%5b%5d=ark:/9999/119460"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark[]=ark:/9999/119460</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark%5b%5d=119460"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ark[]=119460</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id%5b%5d=YLTAD111/51/37"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id[]=YLTAD111/51/37</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id%5b%5d=YLTAD111%2F51%2F37"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id[]=YLTAD111%2F51%2F37</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id%5b%5d='YLTAD111%2F51%2F37"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id[]='YLTAD111%2F51%2F37</span></a><span style="font-family:"Calibri",sans-serif;color:black">'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id%5b%5d='YLTAD111"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id[]='YLTAD111</span></a><span style="font-family:"Calibri",sans-serif;color:black">'<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id%5b%5d=YLTAD111"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id[]=YLTAD111</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id%5b%5d=YLTAD111"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id[]=YLTAD111</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id%5b%5d=YLTAD111;resolve%5b%5d=archival_objects"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?component_id[]=YLTAD111;resolve[]=archival_objects</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id%5b%5d=MS%2015856;resolve%5b%5d=archival_objects"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id[]=MS%2015856;resolve[]=archival_objects</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id%5b%5d=MS"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id[]=MS</span></a><span style="font-family:"Calibri",sans-serif;color:black">
 15856;resolve[]=archival_objects<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id%5b%5d=MS_15856;resolve%5b%5d=archival_objects"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id[]=MS_15856;resolve[]=archival_objects</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id%5b%5d=MS10840-1.1.1;resolve%5b%5d=archival_objects"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id[]=MS10840-1.1.1;resolve[]=archival_objects</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id%5b%5d=MS10840-1.1.1;resolve%5b%5d=archival_objects"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id[]=MS10840-1.1.1;resolve[]=archival_objects</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id%5b%5d=MS10840-1.1.1"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/3/find_by_id/archival_objects?component_id[]=MS10840-1.1.1</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ref_id%5b%5d=15a419a9464353be174f77bdc8f38874"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ref_id[]=15a419a9464353be174f77bdc8f38874</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="background:white"><a href="http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ref_id=15a419a9464353be174f77bdc8f38874"><span style="font-family:"Calibri",sans-serif">http://ourhost.com:8089/repositories/5/find_by_id/archival_objects?ref_id=15a419a9464353be174f77bdc8f38874</span></a><span style="font-family:"Calibri",sans-serif;color:black"><o:p></o:p></span></p>
</blockquote>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black">Every single call returned a 404 error. Can anyone tell me what I'm doing wrong? I'll feel stupid if it's obvious, but I'll still be thankful. Thanks so
 much!<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-family:"Calibri",sans-serif;color:black">Regards,<br>
Alan<o:p></o:p></span></p>
</div>
<p> <o:p></o:p></p>
<div>
<p><b><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif">Alan Manifold | Library Systems & Digital Preservation Manager | Collection Development & Description
</span></b><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif"><br>
State Library Victoria | 328 Swanston Street | Melbourne VIC 3000<br>
T +61 3 8664 7122 | </span><a href="mailto:amanifold@slv.vic.gov.au"><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif">amanifold@slv.vic.gov.au</span></a><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif"><br>
</span><a href="http://slv.vic.gov.au"><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif">slv.vic.gov.au</span></a><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif"><br>
 </span><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif"><img border="0" width="550" height="50" style="width:5.7291in;height:.5208in" id="_x0000_i1026" src="http://www.slv.vic.gov.au/sites/default/files/email_signature/AOC_esignature.png" alt="slv"></span><span style="font-size:11.0pt;font-family:"Century Gothic",sans-serif"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><a href="https://www.slv.vic.gov.au/email_campaign"><span style="text-decoration:none"><img border="0" width="550" height="140" style="width:5.7291in;height:1.4583in" id="_x0000_i1025" src="https://www.slv.vic.gov.au/sites/default/files/email_signature/signature.jpg?9" alt="https://www.slv.vic.gov.au/sites/default/files/email_signature/signature.jpg?9"></span></a><o:p></o:p></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"> <o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
</div>
<p> <o:p></o:p></p>
<p class="MsoNormal">This message and any attachment is intended only for the use of the Addressee and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any dissemination of this
 communication is strictly prohibited. If you have received this communication in error, please delete all copies of the message and its attachments and notify the sender immediately. Thank you.
<o:p></o:p></p>
</div>
</div>
</body>
</html>