[Archivesspace_Users_Group] Updating top container barcode via API

Matthew Adair mladair at umich.edu
Thu Aug 25 11:37:36 EDT 2022


Thanks Trevor,

It turns out I was overthinking the process. I was removing the read only
fields (like long_display_string) and others that weren't necessarily being
updated. I was assuming including those would cause an error. But, just
using the original JSON payload and adding the barcode field did the trick.

Matt

----
*Matt Adair*
Archivist for Digital Imaging and Infrastructure


Bentley Historical Library
1150 Beal Avenue
Ann Arbor, Michigan 48109-2113
734-647-3537
http://bentley.umich.edu
@UmichBentley

*The Bentley Historical Library acknowledges that coerced cessions of land
by the Anishnaabeg and Wyandot made the University of Michigan possible,
and we seek to reaffirm the ancestral and contemporary ties of these
peoples to the lands where the University now stands.*


On Thu, Aug 25, 2022 at 11:10 AM Trevor Thornton <trthorn2 at ncsu.edu> wrote:

> Those conflict errors might mean that you're adding a barcode that already
> exists, which is restricted at the database level so there's no way around
> it.
>
> The standard (or at least a common) approach for doing updates via the API
> is to first get the record you want to update, modify the JSON you get back
> (to add the barcode in your case), then send that updated JSON with your
> POST request.
>
> When I went through the process of adding top container barcodes, I opted
> to make the updates directly to the database because I found it to be
> easier to script. Doing it this way requires you to update the Solr index
> manually – removing data/indexer_state/6_top_container.dat should do that
> (not sure if the '6' in that filename is consistent, but it will always end
> with top_container.dat).
>
> On Thu, Aug 25, 2022 at 10:38 AM Matthew Adair <mladair at umich.edu> wrote:
>
>> Hi folks -
>> I've been trying to come up with a routine to update barcodes in top
>> containers via the API but so far, no luck. The server keeps returning a
>> "409 conflict" error.
>>
>> Anybody know what the minimum requirements for the JSON payload would be
>> to update a container barcode?  Or, perhaps more details on the 409
>> conflict error?
>>
>> Thanks,
>> Matt
>>
>> ----
>> *Matt Adair*
>> Archivist for Digital Imaging and Infrastructure
>>
>>
>> Bentley Historical Library
>> 1150 Beal Avenue
>> Ann Arbor, Michigan 48109-2113
>> 734-647-3537
>> http://bentley.umich.edu
>> @UmichBentley
>>
>> *The Bentley Historical Library acknowledges that coerced cessions of
>> land by the Anishnaabeg and Wyandot made the University of Michigan
>> possible, and we seek to reaffirm the ancestral and contemporary ties of
>> these peoples to the lands where the University now stands.*
>> _______________________________________________
>> Archivesspace_Users_Group mailing list
>> Archivesspace_Users_Group at lyralists.lyrasis.org
>> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>>
>
>
> --
> Trevor Thornton
> Applications Developer, Digital Library Initiatives
> North Carolina State University Libraries
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20220825/699552f2/attachment.html>


More information about the Archivesspace_Users_Group mailing list