Link to attachment files stored in Zotero Storage from external apps

Hello,

Is it possible to link to the attached files in Zotero Storage (eg. PDFs) from external apps?

My use case would be to link to them from To-Do list apps or from "dashboards" in OneNote or Notion related to the projects or classes they refer to, and make a "to-read" list with the attachments easily available on any device that accesses that to-do list or dashboard (and avoid having to have duplicate copies stored elsewhere, and having different work done on different copies of the same file)
  • They're just files on your disk, so you can absolutely just link to them.
    Zotero also has a built-in handler to open specifically PDFs, zotero://open-pdf that takes the form
    zotero://open-pdf/library/items/X8RAB4KG?page=1 where the X8RAB4KG is the item ID, which is the same as the foldername the PDF is stored in. Those links can also be used from other apps -- I don't think they work when Zotero isn't running, though.
  • Sorry, I didn't explain myself well.

    I'm not talking about linking to files on the disk. I'm talkin about linking to them on Zotero Cloud Storage.

    Can I direct link to the files stored on Zotero Cloud Storage from other apps?
  • What is the actual workflow you want to accomplish? What are the steps you want to be able to follow in your daily work?
  • The general answer is "yes, but" -- it's possible to contruct links to files in the Zotero cloud, but that's rarely a good idea and if used should be restricted to personal use. You can't, e.g., use Zotero to host files that you link to from your website or so.
  • OK so in reply to @bwiernik (sorry for the long text, but you asked me to explain and I'll try to do it to the best of my ability - English is not my first language):

    I have many different projects that involve readings. Different classes with required bibliography, different essays I have to write, papers I'm writing that require research, and other skills I'm trying to learn on my own. Also, a lot of these also require reading things I don't normally keep in Zotero (since I try to keep Zotero only scientific articles and research - I know it can be much more than that and I even used it like that in the past, but it just became unmanageable for me).

    I've been feeling this has been hard for me to keep track of (it's the first year I have so many concurrent readings required of me, for many different purposes), to know what I need to read next for each project, or how many things I still have to read before some deadline, for example.

    One way I was thinking of trying to make sense of it all, was to make a kind of "dashboard" either on Notion or OneNote, for each of these projects, where I would keep everything relevant for the project in question, including, among other information, a "to-read/listen/watch" list, with book chapters, videos, podcasts, web pages and also scientific papers. And I was thinking of linking to the ones stored in Zotero Cloud Storage like I can link to the things in my Dropbox for example, for easy access, wherever I am (on my desktop, ultrabook, iPad, work PC, phone, boyfriend laptop, etc).

    I know I can achieve this in other ways. I can simply put a citation taken from Zotero on the "to-read" list and, when needed, search for the relevant article on Zotero and send it to the tablet (or whatever device) with Zotfile. Or just search and download it from the Zotero Web Library. Or I can have a copy of the articles on Dropbox and link that copy (but I was trying to avoid that - having duplicates of the same file, where the two versions not only don't sync with eachother, but are taking space on two different platforms, when I'm already storing them on Zotero paid storage). Or I could just store them in Dropbox and use linked files with Zotfile, as I did in the past, but I'd rather pay for the Zotero Cloud Storage for various reasons.

    So in essence, it's definitely not a "make-it-or-break-it" kind of thing, I can achieve almost the same goal in some other way. I was just wondering if it was possible to do it this way, since it seems the most straightforward (less steps involved and less workarounds, so to speak).


    And in reply to @adamsmith :
    It would be for my personal use only, not to share with anyone else. Only for personal management. But on different devices (although not concurrently - a file would be accessed on one device at a time).

    Do you think I risk some kind of file and/or sync corruption or some other problem and it would be better to avoid it?

    Or if it can be done, where can I get the links to the files attached on Zotero Cloud Storage?
  • Download links take the form
    https://api.zotero.org/users/[userID]/items/[itemID]/file/view?key=[API-key]

    where userID is your numeric Zotero ID, 6597391 in your case
    itemID is the 9 character alphanumeric code
    and the API key is an API key you'd need to generate at https://www.zotero.org/settings/keys

    You can get the first part of that URL (up to and including the itemID) using the "Copy Zotero URI" option from the Zutilo addon.

    You'd then have two options:
    1. Just go with that: it will open the web library selected to that attachment, which you'd then need to click to open
    2. manually add the /file/view?key=[API-key] part every time for direct download. The API key would be the same for every item, so you could have that saved and just add it to the link.

    Not sure if that's convenient enough for you, but I don't think there's an easier option. The use of the API key is the reason you can absolutely not share that link. That'd give someone access to all information in your library.
  • That's great! Thanks so much for the help!
  • This is cool. It seems like a feature could then be keys for read only use for just sharing files? This I think would help some folks like me transition away from Dropbox to Zotero storage.
  • It's read only for your entire library though, so not comparable to a Dropbox share link
  • right.

    maybe something like this though could be added as a feature of the API?

    anyway, just looking for a way to replace the functionality I have with Dropbox with Zotero.
  • Dear Adam

    We have a project management software in which the data for each project is stored, which is then directly synchronised with our homepage. The publications for the individual projects are stored in Zotero (Cloud).

    Now we would like to reference the respective publications in the project management software to the entry in the Zotero cloud via API connector.

    I have the user ID from our Zotero Cloud and have generated an API key.

    If I now use the URL as you specified, I always get the message: No item found.
    The URL looks like this:
    https://api.zotero.org/users/1234567/items/12345678/file/view?key=222222222
    (key is much longer :-)

    A link to a publication in Zotero looks like this:
    https://www.zotero.org/groups/1234567/bass_publikationen/collections/12345678/items/12345678/collection

    Where am I making the mistake?

    Many thanks and best regards
    Georges Burkhalter
  • Note that attachments have a separate item ID from parent Items. The download link needs the itemID of the attachment, not the parent item (which can have multiple attachments, so this wouldn't be a unique ID)
  • Hello Adam

    Thank you for your quick reply!
    Then it is clear to me that the attachementID is needed.

    If I now create the link as follows, it still does not find the document.
    https://api.zotero.org/users/xxx/groups/xxx/collections/xxx/items/xxx/attachment/xxx/file/view?key=xxx

    Can you tell me how to create the correct link?

    And what is the easiest way to read the attachementID from Zotero or the publication? I currently only find it when I open the PDF and then I see the attachmentID in the browser line.

    Many thanks and best regards
    Georges Burkhalter
  • No, you're mixing things up. But also -- "view" doesn't work anymore (that was, I believe, tied to how the web library used to work and never part of the official API -- or I just was wrong last year).
    Instead use "file" (which is the official API version) So, for your personal library, that's
    https://api.zotero.org/users/[usedID]/items/[itemID]/file?key=[apiKey]

    for a group library it's
    https://api.zotero.org/groups/[groupID]/items/[itemID]/file?key=[apiKey]


    As I say above, you can get most of this by using the Zutilo add-ons "Copy Zotero URIs" function.
    That will return
    https://www.zotero.org/users/[usedID]/items/[itemID]
    (or the respectiv group URI) and you only have to switch out www --> api and add
    /file?key=[apiKey]
  • Thank's a lot, Adam! I will try that.
    Best, Georges
Sign In or Register to comment.