<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div>Hi Tommy,<div class=""><br class=""></div><div class="">I’m ready to be wrong on this, but just had a quick look and it seems like the position param is required even though the endpoint declares it as optional.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">James</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 24, 2021, at 9:30 AM, Keswick, Thomas (Tommy) <<a href="mailto:tkeswick@caltech.edu" class="">tkeswick@caltech.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">

<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Greetings.
<div class=""><br class="">
</div>
<div class="">I’m trying to use the <a href="https://archivesspace.github.io/archivesspace/api/#set-the-parent-position-of-an-archival-object-in-a-tree" class="">Set the parent/position of an Archival Object in a tree</a> API endpoint but I am getting an error
 when I supply both the archival object ID and the parent ID in what should be the correct way. The Archival Object is an item-level record and the parent is a series-level record, both under the same Resource.</div>
<div class=""><br class="">
</div>
<div class="">The error is:</div>
<div class="">
<div class="">{</div>
<div class="">    "error": "comparison of Integer with nil failed"</div>
<div class="">}</div>
</div>
<div class=""><br class="">
</div>
<div class="">Here is some sample Python code that fails:</div>
<div class="">```</div>
<div class="">
<div class="">import json</div>
<div class=""><br class="">
</div>
<div class="">from asnake.client import ASnakeClient</div>
<div class=""><br class="">
</div>
<div class="">asnake_client = ASnakeClient()</div>
<div class="">asnake_client.authorize()</div>
<div class=""><br class="">
</div>
<div class="">parent_post_response = asnake_client.post(</div>
<div class="">    "/repositories/2/archival_objects/96413/parent?parent=96414"</div>
<div class="">)</div>
<div class="">print(json.dumps(parent_post_response.json(), sort_keys=True, indent=4))</div>
</div>
<div class="">```</div>
<div class=""><br class="">
</div>
<div class="">The locally installed ArchivesSpace version that I am testing on is 2.8.1 currently.</div>
<div class=""><br class="">
</div>
<div class="">Thanks for any help.</div>
<div class=""><br class="">
</div>
<div class="">Cheers,</div>
<div class="">Tommy</div>
<div class=""><br class="">
</div>
</div>

_______________________________________________<br class="">Archivesspace_Users_Group mailing list<br class=""><a href="mailto:Archivesspace_Users_Group@lyralists.lyrasis.org" class="">Archivesspace_Users_Group@lyralists.lyrasis.org</a><br class="">http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group<br class=""></div></blockquote></div><br class=""></div></body></html>