Call Javascript API to list items in a collection

Reading the Javascript API docs here ...
https://www.zotero.org/support/dev/client_coding/javascript_api
there is reference to Plain Old Webserver.

But on trying to install POW I see that POW is incompatible with Firefox 40. What should I use instead of POW to get collectionID?

From the docs ..

Get the items for a particular collection

var Zotero = Components.classes["@zotero.org/Zotero;1"] .getService(Components.interfaces.nsISupports).wrappedJSObject;
var collectionid = pow_server.GET.id; // or some other way of finding the collectionID here
var collection = z.Collections.get(collectionid);
var items = collection.getChildItems();
// or you can obtain an array of itemIDs instead:
var itemids = collection.getChildItems(true);
  • What collection are you trying to retrieve the ID for? What criteria is this based on? In general, you should post coding questions on zotero-dev@googlegroups.com
  • The only point I was making is that Javascript API docs refers to "POW" but that option (5 years old) can't now be installed on latest Firefox 40.

    I'll now move future dev questions to zotero-dev@googlegroups.com

    Thanks.
Sign In or Register to comment.