how do I retrieve the attachments using zotero api?

155 views
Skip to first unread message

sudheshna iyer

unread,
Jun 3, 2014, 11:28:23 AM6/3/14
to zoter...@googlegroups.com
Hello team,

I need to get all the files from Zotero, including attachments and save them on to my local drive. I use REST services from java.

My main concern is getting the attachments and notes. How do I get all of the items (along with attachments and notes) in one shot?
Which API should I use?

Thank you. 

sudheshna iyer

unread,
Jun 3, 2014, 11:46:14 AM6/3/14
to zoter...@googlegroups.com
What I mean is, how do I get the byte stream of attachments and tags using the zotero api? Which api supports this?


--
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/awPuuournDg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+...@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at http://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/d/optout.

Dan Stillman

unread,
Jun 3, 2014, 2:06:14 PM6/3/14
to zoter...@googlegroups.com
On 6/3/14, 11:46 AM, sudheshna iyer wrote:
> What I mean is, how do I get the byte stream of attachments and tags
> using the zotero api? Which api supports this?

There are rel="enclosure" links in the Atom entries.

sudheshna iyer

unread,
Jun 5, 2014, 11:21:47 AM6/5/14
to zoter...@googlegroups.com
Thanks for your response. I got this by going to :
https://api.zotero.org/users/<uid>/items/<zapi:key>/file?key=<authtoken>

But I am not able to open the pdf's that I downloaded ... All are empty! Not sure what the problem is. Do any of you have any clue? 


--
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/awPuuournDg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to zotero-dev+unsubscribe@googlegroups.com.

Aurimas Vinckevicius

unread,
Jun 5, 2014, 1:16:04 PM6/5/14
to zoter...@googlegroups.com

If by empty you mean 0 bytes, then something is wrong with the query.  Otherwise, I believe they are zipped. Have you tried unzipping them?

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.

Dan Stillman

unread,
Jun 5, 2014, 1:20:45 PM6/5/14
to zoter...@googlegroups.com
(Single files such as PDFs aren't zipped — only HTML snapshots (and it should be clear from the filename).)

If they're actually empty, I'd guess that your HTTP library just isn't following the 302 redirect to the actual file. But you say in your other post that there's a non-zero file size, so I'm not sure what you mean by "empty" here.
Reply all
Reply to author
Forward
0 new messages