<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">You can just send back the lock_version you got with the get. No need to bump it - that happens on a successful update. The response to the update will include the new lock_version, like this:</div><div class=""><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div class=""><div class="">{</div></div><div class=""><div class=""> "status": "Updated",</div></div><div class=""><div class=""> "id": 2,</div></div><div class=""><div class=""> "lock_version": 23,</div></div><div class=""><div class=""> "stale": NULL,</div></div><div class=""><div class=""> "uri": "/repositories/2",</div></div><div class=""><div class=""> "warnings": []</div></div><div class=""><div class="">}</div></div></blockquote><div class=""><br class=""></div><div class="">This is implemented via a sequel plugin:</div><div class=""><a href="https://sequel.jeremyevans.net/rdoc-plugins/classes/Sequel/Plugins/OptimisticLocking.html" class="">https://sequel.jeremyevans.net/rdoc-plugins/classes/Sequel/Plugins/OptimisticLocking.html</a></div><div class=""><br class=""></div><div class=""><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 18, 2020, at 12:53 AM, Peter Heiner <<a href="mailto:ph448@cam.ac.uk" class="">ph448@cam.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Huebschen, Alan M wrote on 2020-04-17 14:26:24:<br class=""><blockquote type="cite" class="">I've been attempting to update existing resource records through the API, the records already exist and I'm trying to upload modified versions of the JSON but I'm getting an error in response.<br class=""><br class="">'error': 'The record you tried to update has been modified since you fetched it.'<br class=""></blockquote><br class="">To update a record, you first need to fetch it to get its lock_version.<br class="">The API will only allow updates to a resource with a lock_version<br class="">greater than the one stored in the database, so you'll need to post your<br class="">data including lock_version+1.<br class=""><br class="">Hope that helps,<br class="">p<br class="">_______________________________________________<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=""><br class="">!DSPAM:5e99c2e335501411550710!<br class=""></div></div></blockquote></div><br class=""></body></html>