Reference implementation for API-use (e.g. simple HTML+JS)

280 views
Skip to first unread message

Bjoern Hassler

unread,
Jun 9, 2018, 8:38:48 AM6/9/18
to zotero-dev
I'm wondering whether there's a 'reference implementation' for the use of the API? The Zotero web-part is here (https://github.com/zotero/web-library, would be nice to link this from https://www.zotero.org/support/dev/web_api/v3/start).

However, it's of course fairly complex. I was thinking more of a simple HTML/js. You pass the js a library id and item/collection id, and it produces the corresponding HTML. (Ideally with page metadata/DC/Highwire as well as COinS/unAPI). Some thoughts also written up here (from forum discussion) http://bjohas.de/go/metadata-and-zotero-api (Google Doc, feel free to ask for edit access).

I suppose one could take some bits from https://github.com/zotero/web-library to achieve this - but then it's quite big, so not immediately clear to me which bits to pull out.

Does anybody want to collaborate on that?

Thanks,
Bjoern

fcheslack

unread,
Jun 9, 2018, 11:11:54 AM6/9/18
to zoter...@googlegroups.com
I'm not sure what the end product pages you'd like to produce look like exactly, but
implements Zotero API usage in a convenient way with little abstraction on top, and in modern javascript. That's probably the cleanest way to get started using the Zotero API from javascript currently (however you will still need to be familiar with how the API works and the available options). The JSON objects from v3 of the Zotero API are perfectly convenient to work with directly.


--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at https://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/d/optout.

Bjoern Hassler

unread,
Jun 9, 2018, 11:18:05 AM6/9/18
to zoter...@googlegroups.com
That's great - thank you.

It would be great if this could be added to https://www.zotero.org/support/dev/web_api/v3/start (What's the policy for wiki editing? Happy to do so myself...)

Is there a simple deployment of it somewhere that I could look at? (Ideally, rather than node.js) 

Bjoern

You received this message because you are subscribed to a topic in the Google Groups "zotero-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/zotero-dev/36suP2OLx-M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.

Bjoern Hassler

unread,
Jun 9, 2018, 6:06:29 PM6/9/18
to zoter...@googlegroups.com
Hello again,

I've put this together:
https://github.com/bjohas/ZoteroApiSimple/blob/master/app.js

A query like this {collection: '2GFF835P'} works as expected, but for {collection: '2GFF835P', item: 'WBR6SFD7'} I couldn't figure out how to just get the item, i.e. the equivalent of  https://api.zotero.org/groups/2129771/items/WBR6SFD7.

Any help would be appreciated!
Bjoern

Bjoern Hassler

unread,
Jun 10, 2018, 6:02:08 PM6/10/18
to zoter...@googlegroups.com
Hello all,

Just to say that — thanks to input from Tom —  https://github.com/bjohas/ZoteroApiSimple now kinda works. The UI is very basic, but you can browse through collections and items (for public groups). Items are supplied with COinS, which are picked up by the Zotero ccnnector. 

Happy to pass on what I learned, if there are any questions!
Bjoern
Reply all
Reply to author
Forward
0 new messages