[Archivesspace_Users_Group] partially update a record through API

Chris Fitzpatrick Chris.Fitzpatrick at lyrasis.org
Tue Nov 25 08:58:52 EST 2014


Hi Mang Sun,


If you're doing it this way, you'll need to get the JSON first and add the publish: false value, then POST that back. 

I can write a small script for you that does this, if you're interested...
b,chris 

Chris Fitzpatrick | Developer, ArchivesSpace
Skype: chrisfitzpat  | Phone: 918.236.6048
http://archivesspace.org/

________________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Mang Sun <mang.sun at rice.edu>
Sent: Thursday, November 20, 2014 6:34 PM
To: archivesspace_users_group at lyralists.lyrasis.org
Subject: [Archivesspace_Users_Group] partially update a record through API

I am trying to partially update accession records by setting PUBLISH to
false using REST API, but I can't get it done successfully.
For example, run the following command to update one accession record,
curl_as username password -d "@accession.json" -v "the AS API
url/repositaries/2/accession/1"

accession.json contains
{
"publish" : false
}

but I get the following complaints

{"error":{"id_0":["Property is required but was
missing"],"accession_date":["Property is required but was
missing"]},"warning":null,"invalid_object":"#<JSONModel(:accession)
{\"publish\"=>true, \"jsonmodel_type\"=>\"accession\",
\"external_ids\"=>[], \"related_accessions\"=>[], \"subjects\"=>[],
\"linked_events\"=>[], \"extents\"=>[], \"dates\"=>[],
\"external_documents\"=>[], \"rights_statements\"=>[],
\"deaccessions\"=>[], \"related_resources\"=>[],
\"restrictions_apply\"=>false, \"access_restrictions\"=>false,
\"use_restrictions\"=>false, \"linked_agents\"=>[], \"instances\"=>[]}>"}


Any idea?

Mang Sun
Rice U.

_______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group at lyralists.lyrasis.org
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group



More information about the Archivesspace_Users_Group mailing list