Web API prevent creating duplicate keys

I would like to hereby request that the WebAPI is changed so that the creation of duplicate keys is prevented.

I'm currently working with Overleaf and noticed that not only does the imported bibliography not use the keys I set with Better Bibtex - which wouldn't be a problem on its own - but the API seems to be just overwriting the keys generated by the Zotero client. And even worse, there seems to be no safeguard whatsoever to prevent having two entries have the same key. This should not happen.
  • You can pin BBT citation keys (they'll show up in Extra with Citation Key:) and those will get picked up by the API and thus remain stable.
    The way Zotero's built-in bibtex export works, there's know way to keep citekeys stable/non-duplicate (it's not aware of previous exports)
  • It doesn't need to be aware of previous exports, but it most definitely should be aware of its current exports. I'm not talking about exporting several Groups, I'm talking about exporting a single Group for Overleaf to import. Within this group, keys are duplicated. Something I'm quite sure wouldn't happen by the Zotero Client's automated key assignment.
  • API responses are paginated... I told you how to address this, until Zotero has native cite keys, that's the only way
  • Native cite keys? How does it not have them is the better question then. Because whenever I add a source a key was automatically assigned and I don't think they where assigned by BBT...
  • If you could see them, they were assigned by BBT
  • There maybe a misunderstanding at play. When @Artim96 says
    whenever I add a source a key was automatically assigned
    he may mean "I created an entry in Zotero, I let it sync to overleaf, and when it showed up, it had a key assigned".

    In that case, such keys are somewhat volatile in the way that @adamsmith means, in that API pagination can make it happen that keys that are only distinguished by a postfix sometimes don't get one, or get the wrong one, leading to key clashes. The only way to (currently) prevent this is to enter the key into the extra field; one of the things that BBT does is automating that procedure.
  • edited February 16, 2024
    I'm currently working with Overleaf and noticed that not only does the imported bibliography not use the keys I set with Better Bibtex
    another possible (and more likely given adamsmith's earlier anwer, sorry; I should have read more attentively) interpretation: you do have BBT keys locally, but they are not pinned, and those keys don't sync to overleaf. You can turn on auto-pinning to remedy that. That will write them into the extra field, and those keys show up in overleaf.
  • It doesn't need to be aware of previous exports, but it most definitely should be aware of its current exports.
    There is no concept of "current exports" in the Zotero web API. Whenever something relevant changes, Overleaf requests a new export, and there's no memory of what was requested before.
    Something I'm quite sure wouldn't happen by the Zotero Client's automated key assignment.
    Not by BBT, no, but without BBT, local keys can in fact change from one export to another, eg if you added a new item to a collection you exported, or if you export the same item from different collections it's in. This was the issue that started BBT 11 years ago.
Sign In or Register to comment.