Can we delete records through the API?

38 views
Skip to first unread message

Paul Collins

unread,
May 25, 2021, 1:52:43 PM5/25/21
to AtoM Users
Hi. Our archivist has asked me if we can use the API to do mass deletion of unwanted records, to save time manually clicking and deleting each one.

Looking at the developer documentation, it seems this may not be possible: the available endpoints are "browse taxonomy terms", "browse information objects", and "read information object".

Is there any convenient way to delete records automatically? Maybe this would be a useful feature to add to the API?  I suppose we could also do it through MySQL but there might be issues around foreign-key integrity in related tables -- I would be reluctant to jump in there and start issuing DELETE commands.

Paul C.


Paul Collins

unread,
May 25, 2021, 1:55:12 PM5/25/21
to AtoM Users
To clarify: by "unwanted records" I mean a list of AtoM reference codes or what-not. I'm not suggesting that the system should automatically determine on its own what to delete.  Merely that we might want to delete a large batch (including any related JPEG attachments etc) without all the manual mouse-clicking. -- Thanks!

Dan Gillean

unread,
May 26, 2021, 9:15:20 AM5/26/21
to ICA-AtoM Users
Hi Paul, 

At present, no - the API endpoints do not support deletion. 

However, there is a command-line task that can be used for deletion. See: 
  1. If you delete a parent record, the deletion will cascade to the descendants
  2. There is an option to delete all descriptions associated with a particular repository
  3. There's also a separate CLI task that can delete all drafts, described here
One way this task could potentially be extended would be to allow the user to provide a file with a list of slugs for deletion. I imagine this would require less development effort than adding a new API endpoint. 

I don't recommend performing deletions via MySQL if you can avoid it, since data is spread across multiple tables, and you could leave partials if you're not careful. 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/056d2bd3-2f44-4305-b610-e95f8cfa0fe8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages