[Archivesspace_Users_Group] Updating containers via archival_object POST

Lora Davis ljdavis at jhu.edu
Tue May 23 09:27:54 EDT 2017


Hi Don,

What version of ASpace are you running?  I’m guessing either 1.4.2 with container management plugin or 1.5+…

If that is the case, then the problem is that the data you are trying to change in the snippet below isn’t actually controlled from within “container” anymore.  You’ve actually got to look for & change the “sub_container” and/or the “top_containers” record linked to from “sub_container”:

"instances": [
    {
      "sub_container": {
        "indicator_2": "2",
        "type_2": "folder",
        "jsonmodel_type": "sub_container",
        "top_container": {
          "ref": "/repositories/3/top_containers/12063"
        }
      }
    }
  ]

So, in the blob you provide below, type_1, indicator_1, and barcode_1 could be modified by POSTing to the linked top_container record, and type_2 and indicator_2 could be changed by POSTing the AO back with modifications to sub_container instead of container.

Yes, it’s a pain.  I’m spending the ocassional down moment working on a script to automate some of this for us here (GET record, dump into a csv, processing archivists make changes in csv, then it POSTs back to the proper records/subrecords), but it is no where ready for primetime yet, and won’t be for a while.

Though, if anyone has this work already complete, I’m all ears! ☺

Lora

From: archivesspace_users_group-bounces at lyralists.lyrasis.org [mailto:archivesspace_users_group-bounces at lyralists.lyrasis.org] On Behalf Of Donald Mennerich
Sent: Monday, May 22, 2017 4:11 PM
To: Archivesspace Users Group <archivesspace_users_group at lyralists.lyrasis.org>
Subject: [Archivesspace_Users_Group] Updating containers via archival_object POST

Hello List,
I'm working a data remediation problem via the aspace API I can't seem to get any of the values in a container key within an archival_object to update when I post. For example, within a json object of type archival_object like:

"container": {
    "type_1": "box",
    "indicator_1": "1",
    "barcode_1": "31142054615128",
    "type_2": "folder",
    "indicator_2": "14",
    "container_locations": [],
    "lock_version": 25
}
If I change any of the values and POST, none of the updates seem to persist. This doesn't generate an errors, and any changes to the record otherwise seems to save. I'm wondering if this is just not possible, and if so, is there another endpoint that might be used to update container information?

Thanks, Don

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20170523/5150a18d/attachment.html>


More information about the Archivesspace_Users_Group mailing list