[Archivesspace_Users_Group] Entering a Second Location through the API

Valerie Addonizio vaddonizio at atlas-sys.com
Fri Apr 2 11:52:59 EDT 2021


Kate,

I can offer general advice. I recommend adding more than one location to a top container in the staff interface first, as a sample, and then getting out that record through the API to use as a template for understanding how this should look. You'll see that multiple locations are listed in the container_locations array, separated by a comma. Treat that array like a list, append the new location, and then post the top_container record back with the longer array. Below is a sample of a single top container with two Current locations. The only data required when you append to the array is:

        {
            "status": "current", <-- Or temporary
            "start_date": "2021-04-02",<-- Your choice
            "ref": "/locations/3" <-- where this is your new location
        }

Sample GET showing multiple locations:

{
    "lock_version": 9,
    "barcode": "10100151637763",
    "indicator": "1",
    "created_by": "admin",
    "last_modified_by": "admin",
    "create_time": "2021-03-31T20:59:17Z",
    "system_mtime": "2021-04-02T15:38:24Z",
    "user_mtime": "2021-04-02T15:38:24Z",
    "type": "box",
    "jsonmodel_type": "top_container",
    "active_restrictions": [],
    "container_locations": [
        {
            "jsonmodel_type": "container_location",
            "status": "current",
            "start_date": "2021-04-02",
            "system_mtime": "2021-04-02 15:38:24 UTC",
            "user_mtime": "2021-04-02 15:38:24 UTC",
            "ref": "/locations/1"
        },
        {
            "jsonmodel_type": "container_location",
            "status": "current",
            "start_date": "2021-04-02",
            "system_mtime": "2021-04-02 15:38:24 UTC",
            "user_mtime": "2021-04-02 15:38:24 UTC",
            "ref": "/locations/2"
        }
    ],
    "series": [],
    "collection": [
        {
            "ref": "/repositories/101/accessions/1",
            "identifier": "mss--acc--1",
            "display_string": "Accession 01"
        }
    ],
    "uri": "/repositories/101/top_containers/624",
    "repository": {
        "ref": "/repositories/101"
    },
    "restricted": false,
    "is_linked_to_published_record": false,
    "display_string": "Box 1: [Barcode: 10100151637763]",
    "long_display_string": "Box 1 [Barcode: 10100151637763], yuiu [fdfd: a], mss--acc--1, Accession 01"
}



From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> On Behalf Of Herbert, Kate F
Sent: Thursday, April 1, 2021 3:35 PM
To: archivesspace_users_group at lyralists.lyrasis.org
Subject: [Archivesspace_Users_Group] Entering a Second Location through the API

I am pretty new to the API and we are currently undergoing a move of our entire collection (just over 58,000 top containers) for a multiyear repair to our building. I am trying to find a way to put in the new locations but keep the old locations, as they will still be useful for reference points to our old finding aids.  I know how to update a top container record in the API but I am  can not seem to make it work with more than one location. Any ideas on how this could be done would be helpful. We have a hosted instance and no direct access to the back end.

Thanks,

Kate Herbert
Digital Archivist
Maine State Archives
kate.f.herbert at maine.gov<mailto:kate.f.herbert at maine.gov>

(she/her/hers)



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20210402/323377e5/attachment.html>


More information about the Archivesspace_Users_Group mailing list