JSON returned is different when fetching in browser and by javascript

25 views
Skip to first unread message

Lennart Borgman

unread,
May 28, 2014, 7:02:57 PM5/28/14
to zoter...@googlegroups.com
If I fetch this URL by directly pasting it in the browswer's address field (Chrome) I get a different JSON returned than if I use XMLHttpRequest:

    https://api.zotero.org/groups/56508/items/3B6TR25A?format=atom&content=json

The "itemKey" field is for example missing in the browser but is present in the javascript return value.

Dan Stillman

unread,
May 28, 2014, 7:19:25 PM5/28/14
to zoter...@googlegroups.com
It's API v1 vs. v2. Version 1 is still the default, and you have to pass
an HTTP header to get v2. For testing, cURL is generally the best option.

We're adding a query parameter in v3 as an alternative way to control
the version.

Lennart Borgman

unread,
May 28, 2014, 9:13:10 PM5/28/14
to zoter...@googlegroups.com
Thanks Dan, I just remembered and was going to tell that. Sorry for disturbing.
Reply all
Reply to author
Forward
0 new messages