Search items on a Serie with API

13 views
Skip to first unread message

99b...@gmail.com

unread,
Oct 30, 2019, 4:27:11 AM10/30/19
to AtoM Users
Hello


I would like to recover all the items that belong to a serie defined in Atom via API. I know how to do it with Fonds but I don't see if it is possible to do the same with other "group" levels like Serie or Subserie.

For a fond I use http://<server>/api/informationobjects?collection=<fond-id>

Thanks in advance

Dan Gillean

unread,
Oct 31, 2019, 11:33:25 AM10/31/19
to ICA-AtoM Users
Hi there, 

Unfortunately, I'm not sure there is a way to do this currently - unless you can think of a query that will return the target records based on some other common criteria. 

I did try seeing if the collection parameter could be used with a series, if you know the objectID of the series - however, in the user interface at least, this will return the correct series-level record, but not its children. I suspect it will be the same for the API endpoint, but if you want to try, I'll explain what I did below. 

First, take the slug of the target series. We will use this in a SQL query to fetch the object ID. 

To access the MySQL terminal prompt, you will need to know your database name, and the user credentials (username and password) used during installation. Here is an example, when the user and password are root, and the database is named atom
  • mysql -u root -proot atom;
Once there, we can use the following query to get the objectID of the series when we know the slug: 
  • SELECT io.id FROM information_object io JOIN slug s ON s.object_id=io.id WHERE s.slug='enter-your-slug-here';
Replace the enter-your-slug-here part of the example above with the permalink (i.e. the slug) of the target series. This should return the object ID. 

If you don't know the database credentials, one workaround is to export the series as a CSV - the value in the legacyID column of the export CSV is the internal object ID. 

Once you have the objectID, you can try using it in the query you were using for fetching the fonds, like so: 
  • http://<server>/api/informationobjects?collection=<series-id>
As I said, I'm not sure if this will work unfortunately, but it might be worth a try. 

Otherwise, you could try to identify - or even add - some common criteria, such as a subject access point which is only used on the series and its descendant records. 

Good luck! 

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


--
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/c59e2d40-b741-4103-88a5-cbe930c7bae0%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages