Question about connector API to communicate with local standalone zotero

68 views
Skip to first unread message

parchd...@archlinux.info

unread,
Feb 18, 2017, 12:46:16 PM2/18/17
to zoter...@googlegroups.com
As posted in the zotero forum, I've been playing around with standalone
zotero trying to add items from the command line using the connector
api.
I've successfully added webpage items with the saveSnapshot endpoint,
but am not having any luck with savePage.

Adomasven responded that there are two mandatory parameters - uri and
html. I have been passing both of these (and sometimes cookie, to test),
but to no avail. There is no response from zotero to the request,
nothing in the debug log, and no item is added.

I've tried with the following items, both of which have translators:
http://ajcn.nutrition.org/content/33/12/2657.short
http://www.sciencedirect.com/science/article/pii/S2351979716300718


I'm testing this with the current version of zotero 5. I notice that
tests/server_connectorTest.js has no test for the savePage endpoint.

Any suggestions?

parchd

unread,
Feb 19, 2017, 9:21:16 AM2/19/17
to zoter...@googlegroups.com
Ok, so it seems that it does work if I also provide the translatorID - I
would have expected zotero to do this itself, as being as it is the
detect endpoint that gave it me in the first place.

Sciencedirect never works (at least, not for a non-logged in user. I
haven't yet tested when logged in. It returns a 500.

On multiple occasions I've had the item successfully added, but no
response from zotero. The connection stays open. I've been testing with
both zotero 4 and 5, and I've lost track of whether it happens
more/exclusively with one or the other.

Adomas Venčkauskas

unread,
Feb 21, 2017, 7:49:43 AM2/21/17
to zotero-dev, parchd...@archlinux.info
Sorry for the confusion and taking a while to respond. The indeed requires a translatorID to be supplied. I've submitted a PR to address this.

I've tested with sciencedirect myself and didn't have any problems. Post a problematic URL and I can take a look.

Overall, to have a better idea, you can start Zotero 4.0 with the flag -ZoteroDebug or Zotero 5.0 with -ZoteroDebugText to output debug log into the console. That should give you a better idea about what Zotero is doing when calling the endpoints.

In general, /connector/savePage will respond with status 500 if it fails to find a viable translator. You can then use /connector/saveSnapshot, which will create a basic webpage item and a snapshot for the page. 
It might also respond with status 300, an instanceID and a list of possible items on a page in which case you will need to send a request to /connector/selectItems with the instanceID and IDs of the items you want to save 
Reply all
Reply to author
Forward
0 new messages